Repository navigation
Conversation
A retired subscription stays in the multiplexer until its unsubscribe has been issued (#3363), so a reconnect or reconfigure in that window could subscribe it again; nothing would then unsubscribe it, because the client forgets it straight after. The ensure paths now do nothing for a retired subscription. This narrows the window rather than closing it: a restore that reads 'not retired' just before the unsubscribe retires it can still send its subscribe afterwards. See #3375.
…is unsubscribed An unsubscribe that lands while the subscribe is still unacknowledged has no server to send anything to, because the server is only recorded when the acknowledgement arrives. The acknowledgement was then adopted by a subscription the client had already forgotten, and the server stayed subscribed (#3375). The acknowledgement is now treated as a stray when the subscription is retired, and the registration it confirms is removed. Exactly one side owns that removal: retiring takes the recorded server(s) after marking the subscription retired, an acknowledgement records its server before checking for retirement, and whichever takes the server back out sends the unsubscribe. If the channel has been subscribed afresh in the meantime, the stray is only removed when the newer subscription is known to be on another server; an unsubscribe that followed the newer subscribe onto the same server would silently stop its messages. Tests adapted from #3337. Co-authored-by: vkyow <218959617+vkyow@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Work in progress for #3375. Draft: more commits to come.
So far
Restores skip a subscription that is being retired. Since #3363, a subscription whose last handler has been removed stays in the multiplexer until its unsubscribe has been issued. A reconnect or reconfigure in that window could subscribe it again, and nothing would then unsubscribe it, because the client forgets it straight after. The ensure paths (single-node and multi-node, sync and async) now do nothing for a retired subscription.
Test:
RestoreDoesNotResubscribeARetiredSubscription(literal, pattern and multi-node channels; sync and async). All six cases fail without the change.This narrows the window and does not close it: a restore that reads "not retired" just before the unsubscribe retires the subscription can still send its subscribe afterwards. That is covered by the ack-time work below.
Still to do