Repository navigation
fix(net): register subscriptions before exposing track demand - #5991
Conversation
Register subscriptions before requests or demand can wake their serving session, and derive each subscribed origin query from that same track instance. Remove the TRACK_STATUS fallback to SUBSCRIBE so query-only and fetch-only refusals remain terminal. Validation: all four deterministic regressions pass, including the scripted peer refusing TRACK_STATUS with 0xFFFFFFFF. The two model regressions failed before the model fix; the front regression still failed with only the model fix. Full moq-net tests are running; just check remains pending. External relay reporting remains deferred under the authorized GitHub organization scope. Co-Authored-By: GPT-6.1-Sol <noreply@openai.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 13 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6e02817cf1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Registering a subscription wakes the serving session, which may re-enter the broadcast. Join the live track after releasing the broadcast lock and look the name up again if its idle teardown wins the race. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main dropped Demand::poll_used. poll_state arms the same first-consumer edge while the track is idle. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-race # Conflicts: # rs/moq-net/src/ietf/subscriber.rs
#5991 landed the fix and deferred only the upstream reports. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Problem
A subscribing reader could expose its track request before its subscription was registered. An IETF session could then send TRACK_STATUS and fail the reader when the peer refused it.
Fixes #5954.
Approach
Register subscriptions before publishing requests or demand, preserving the atomic check against idle teardown. The origin front subscribes before querying that same track instance. Remove the obsolete NOT_SUPPORTED fallback to SUBSCRIBE.
A broadcast lookup joins an already-served track after releasing the broadcast lock, so the subscription and first-consumer wakes never run under it: a woken session may re-enter the broadcast. The track's own lock still orders the join against its idle teardown, and a join that loses that race looks the name up again. Joining a queued request stays under the lock and wakes no subscription observer, since only a handler that popped the request can watch its subscriptions.
Deterministic wake-driven tests reproduce both ordering races, including a catalog subscriber against a peer that refuses TRACK_STATUS with 0xFFFFFFFF, and a re-entrant waker that deadlocked when the lookup woke it under the broadcast lock. Query-only and fetch-only refusal tests cover six supported drafts.
Decisions
Codex P2 (wake subscription observers outside the broadcast lock):
Preferences::registerup throughresolve_trackand wake after the guard drops. Covers only the new wake; the first-consumer wake and the unregister wake still run under the lock.Impact
Validation
a_subscription_wakes_its_observers_outside_the_broadcast_locktimes out under nextest with the lock held across the join, and passes with the fix.just checkpasses on the new head.Alternatives
Waiting or polling in the IETF subscriber and widening the fallback would hide the ordering bug. The request's subscription is registered at its source instead.
Follow-ups
The upstream report about peers refusing TRACK_STATUS remains deferred. The quest stays until that reporting step is resolved.
🤖 Generated with Claude Code
(Written by GPT-6.1-Sol, updated by Claude Opus 5.5)