fix: hand back the subscription when the sub reply is abandoned or expires - #389
Merged
Merged
Conversation
A caller is handed a subscription exactly when a registry entry was written. Supersede ADR-0006, refresh the stale ADR-0004 and ADR-0003 sentences, and split the handle tests so each path fails by name.
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.
Proposed changes
sendSubscriptionrecorded the subscription on theAbandonedRequest/ExpiredWaitbranch but droppedrememberSubscription's return value, so the caller gotundefinedfor a stream the registry genuinely held. With no handle there was nounsubto send, and the orphaned entry was re-established on every reconnect for the rest of the session.The branch now returns the recorded subscription, establishing the invariant that a handle exists exactly when a registry entry exists. The two adjacent paths already satisfy it: a reply that carries no
subs, and a subscribe with no live connection, both write no entry and return nothing.Closes #386
Steps to reproduce
subreply be abandoned, or its wait expire, while the connection is still installed.undefinedwhile the subscription registry holds the entry.unsubto send.Tests