Repository navigation
feat(net)!: leave subscriptions and fetches to flow control - #6467
Conversation
Quest-Claim: 578f46a02720f2a0
`session::Limits` drops `subscriptions` and `fetches`: every moq-lite request and every draft 17+ moq-transport request holds a stream, so stream credit bounds them, and on drafts 14 to 16 the request window does. `requests` replaces them where they still fed a bound: the window, the draft 17+ skipped-ID history, and the PUBLISHes a peer's listings hold. The relay config follows, and the memory transport gains bidi stream credit so a test can prove the peer stays bounded. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Implementation is complete and local checks pass; this stays a draft for the three decisions in the description (field name Suggested follow-ups:
(Written by Claude Opus 5.5) |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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 19 seconds. 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. |
|
@codex review (Written by Claude Opus 5.5) |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d1f2e287ff
ℹ️ 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".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bca38c781b
ℹ️ 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".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 33a39aaddd
ℹ️ 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".
…ered A peer that cancels a SUBSCRIBE whose token the application already took now keeps the request stream (and so its stream credit or request window slot) until the application answers or drops the token. Without this, a peer could cancel and resubscribe to pile up verifications beyond its credit, which the removed subscription cap used to bound. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review (Written by Claude Opus 5.5) |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ec60f3d088
ℹ️ 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".
# Conflicts: # rs/moq-net/src/ietf/publisher.rs # rs/moq-net/src/lite/publisher.rs
The earlier fix only covered the initial token. A peer could also cancel after the application took a REQUEST_UPDATE renewal, freeing the request's credit while the verification stayed in flight. The subscription's auth hold now carries a kio consumer, and the request stream closes, after PUBLISH_DONE, only once every token verification holding it has been answered or dropped. Demand is still released at once. This replaces the withdraw/poll_released verdict API. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Merge pass summary (head 92423bf):
Checks: (Written by Claude Opus 5.5) |
Quest: Session limits only where needed
Summary
moq_net::session::Limitsdrops thesubscriptionsandfetchescaps, which only refused at runtime what flow control already bounds, and gainsrequestsfor the one bound they also fed: the drafts 14 to 16 request window. The documented example now compiles (it is a doctest).Proof that each removed cap is covered, per version:
live <= window)requests(tracks past it are skipped as before)Stream credit holds because every transport we accept on returns bidi credit only once both halves of a stream close: moq-quic (QUIC, WebTransport), Rust qmux (moq-quic's state machine), and iroh. A peer past it waits; it is not refused.
What stays:
announces: lite announces share one stream and IETF namespaces have no other bound.requests: withannouncesit sizes the drafts 14 to 16 window (2 * (announces + requests)), the draft 17+ skipped-ID history, and the listing PUBLISH bound above. Defaults keep the window where it was: 100,000 + 20,000 in moq-net and on relay peers.subscriptions_peakstat. Subscriptions are still counted (uncapped) so the peak keeps reporting. On moq-lite it now counts SUBSCRIBE streams only, rather than TRACK, SUBSCRIBE, and TRACKS streams deduplicated per track; that per-trackInterestsmap existed only for the cap and is deleted.Test:
request_caps::flow_control_bounds_the_subscriptions_a_peer_holdsasks for 24 subscriptions against a window of 8 and 8 bidi streams, on drafts 14, 15, 16, 17 and lite-06, and checks the server holds at most 8 while the session stays open. It fails (24 held) with both bounds lifted. To express bidi credit,transport::memory::Configgainsmax_concurrent_bi_streams, mirroringmax_concurrent_uni_streams; a bidi stream holds credit until the peer is done with both halves.Deleted tests that only exercised the removed caps:
fetch_caps.rs,held_tracks_share_the_cap_with_their_subscriptions, the lite and IETF "past the cap closes the session" unit tests,coalesced_fetches_each_hold_their_own_slot, and theInterestsunit test.Also aligned IETF join after finish, whose recommendation charged finished entries to the removed subscription limit.
Dropped: the JS mirror.
@moq/netkeeps its internal subscription and FETCH caps, because@moq/qmuxreturns MAX_STREAMS credit on accept rather than on close, so stream credit does not bound open streams there. Its comments now say so.Public API and wire impact
moq_net::session::Limits:subscriptionsandfetchesremoved,requestsadded (unreleased type; theMIGRATE.mdentry for feat(net)!: bound peer-declared lengths and per-session requests #4820 is rewritten).moq_net::transport::memory::Config::max_concurrent_bi_streamsadded (non-exhaustive struct).[session]/[peer]subscriptionsandfetches(--session-subscriptions,--session-fetches,--peer-subscriptions,--peer-fetches, and their env vars) replaced byrequests(--session-requests,--peer-requests,MOQ_SESSION_REQUESTS,MOQ_PEER_REQUESTS). Unreleased; old keys fail loud viadeny_unknown_fields.TOO_MANY_REQUESTS. Relay clients on moq-lite or draft 17+ may hold up to[quic] max_streams(10,000 by default) subscriptions instead of 1,000.Decisions
requests, since the relay needs a lower bound for untrusted draft 14 to 16 clients than for peers. Rejected:window(it also bounds listing PUBLISHes and ID history) and no field with a fixed window.[session] requestsdefault: 10,000 (window 22,000), not 11,000 to keep the old 24,000 exactly.requestsin this PR, since nothing else bounds the PUBLISH tasks a draft 17+ peer's listings spawn. Rejected for now: opening each PUBLISH only as the peer's stream credit admits.Checks
just check: pass (lint and tests for the changed packages, includingcargo test -p moq-net).just test interop --all: pass.🤖 Generated with Claude Code
(Written by Claude Opus 5.5)