Reset open subgroups when a subscription is cancelled - #299
Open
afrind wants to merge 1 commit into
Open
Conversation
When a subscription's read loop is parked in readStreamData on an open subgroup, session cleanup could leak the open subgroup consumer: the transport may cancel the read handle without enqueuing an error, which the state-token await misses. cleanup() now cancels the subscribe state to wake the parked loop, and ObjectStreamCallback::isCancelled() no longer treats a cancelled subscription as terminal for an open subgroup, so the consumer still receives its owed reset() per the MoQConsumers contract. This also applies to app-initiated unsubscribe(), which shares the same cancel() path: an open subgroup is now reset() on unsubscribe. Updated the Unsubscribe and UniControlDataStreamBeforeSetup tests to expect it, and added OpenSubgroupResetDuringSessionCleanup covering the cleanup case. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Collaborator
Author
|
Upstream facebookexperimental#202 is stalled. I will check |
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.
When a subscription's read loop is parked in readStreamData on an open subgroup, session cleanup could leak the open subgroup consumer: the transport may cancel the read handle without enqueuing an error, which the state-token await misses. cleanup() now cancels the subscribe state to wake the parked loop, and ObjectStreamCallback::isCancelled() no longer treats a cancelled subscription as terminal for an open subgroup, so the consumer still receives its owed reset() per the MoQConsumers contract.
This also applies to app-initiated unsubscribe(), which shares the same cancel() path: an open subgroup is now reset() on unsubscribe. Updated the Unsubscribe and UniControlDataStreamBeforeSetup tests to expect it, and added OpenSubgroupResetDuringSessionCleanup covering the cleanup case.
This change is