Repository navigation
fix(net): open SUBSCRIBE_TRACKS PUBLISHes only as stream credit admits - #6641
Conversation
Quest-Claim: 8fc5ec92fb0be442
A listing spawned a PUBLISH task per track as it enumerated, each waiting on stream credit, so a peer that withheld credit made the session hold one task per catalog track, bounded only by `Limits::requests`. Each broadcast now stages one track at a time and opens its stream only once credit admits it, reading the listing meanwhile so removals still end PUBLISHes and return credit. A FORWARD=1 listing reads its next track only once the request stream took the last skip. The listing no longer uses `Limits::requests`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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. |
|
No actionable comments were generated in the recent review.
|
#6644 finishes and deletes js-qmux-credit.md, so the JS listing pacing lives in quest/m1/js-listing-credit.md instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Merging head 0a2a446: CI green (11/11), Codex reviewed this head with no findings, (Written by Claude Opus 5.5) |
Quest: SUBSCRIBE_TRACKS listings follow stream credit (deleted here, since this finishes it).
Summary
A draft-18+ SUBSCRIBE_TRACKS listing used to start a PUBLISH task for every track as soon as it read the track. Each task held a subscription slot, a track handle, and a draft-18 claim, and waited on stream credit. A peer that withheld credit therefore made the session hold one task per catalog track, for every peer. The only bound was
Limits::requests, a runtime cap, and tracks past it were skipped.Now, in
rs/moq-net/src/ietf/publisher/tracks.rs:Stream::poll_openinside the broadcast's wait). The PUBLISHes a peer holds are therefore bounded by the credit it grants. The listing keeps being read meanwhile, because an unlisted track's PUBLISH_DONE is what returns credit; stopping the reads could deadlock a peer whose credit is all held by PUBLISHes of removed tracks. Tracks read but not yet PUBLISHed sit in a per-broadcastpendingmap. Each entry is moved out of the listing's own queue, not copied, so this costs no more than leaving the track unread. Skip checks (properties this draft can't describe, the draft-18 duplicate claim) run as a track is staged, so a stream is only opened for a PUBLISH that actually goes out.Limits::requests. The IETFsubscriptionsslots are counted only for thesubscriptions_peakstat (Slots::default()), and a PUBLISH takeshold()once its stream opens.Tests, swept over catalog sizes 4, 64, and 512 so any per-table cost would show up as a slope:
a_listing_publishes_only_as_credit_admits(drafts 18 to 22): a peer with 2 bidi streams of credit that reads nothing holds exactly 2 PUBLISHes. Once it refuses each one, every track is PUBLISHed exactly once and the count never goes above 2. On the old code it holds 4 (the whole catalog).a_forwarding_listing_reads_only_as_skips_go_out(drafts 19 and 22): exactly one skip is queued until it is taken, and then each track is skipped once. On the old code all 4 are queued at once.past_the_request_limit_a_track_is_skipped, which only exercised the removed cap.Docs:
Limits::requestsrustdoc,doc/bin/relay/config.md, anddoc/concept/standard.md(Rust paces by credit, JS still caps). Pacing the JS listing the same way is a new m1 quest, JS SUBSCRIBE_TRACKS follows credit, so this PR no longer editsquest/m1/js-qmux-credit.md, which moq-dev/moq#6644 finishes and deletes.Choices made without asking
Tracksqueue, which holds the live set for every reader. Getting below that floor would mean changing the model's listing to a cursor, which I left out of scope.@moq/netkeeps its listing cap until that quest lands on top of the@moq/qmuxcredit fix.Public API and wire impact
Limits::requestsstays, and its doc drops the listing bound.requestscap, a track now waits for stream credit instead of getting PUBLISH_SKIPPED (PUBLISH_BLOCKED on draft 18).Checks
just check: pass.just test interop --all: pass.🤖 Generated with Claude Code
(Written by Claude Opus 5.5)