Skip to content

smp server: refactor subscriptions and delivery in order to always response SOK on subscription with an optional message to follow. #1573

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

epoberezkin
Copy link
Member

No description provided.

@epoberezkin epoberezkin requested a review from spaced4ndy as a code owner June 17, 2025 21:51
@@ -1957,21 +1974,6 @@ client
VRVerified q -> Right (q, t'')
VRFailed e -> Left (corrId', entId', ERR e)

deliverMessage :: T.Text -> QueueRec -> RecipientId -> Sub -> Maybe Message -> IO (Transmission BrokerMsg)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this function unnecessarily duplicates the check for ProhibitSub at call sites and prevents different usage of messages in SUB and in ACK commands.

-- queue is usually deleted by the same client that is currently subscribed,
-- we delete subscription here, so the client with no subscriptions can be disconnected.
sub <- atomically $ TM.lookupDelete entId $ subscriptions clnt
liftIO $ mapM_ cancelSub sub
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the lack of cancel was potentially a memory leak

@epoberezkin epoberezkin changed the title smp server: refactor subscriptions and delivery smp server: refactor subscriptions and delivery in order to always response SOK on subscription with an optional message to follow. Jun 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant