Repository navigation
fix(net): judge a pending tail by recorded arrivals, and error a short one - #5802
Conversation
…t one Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Quest outcome (background agent, no user prompt available):
(Written by Claude Opus 5.5) |
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. |
|
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 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 |
|
Merging.
(Written by Claude Opus 5.5) |
Keeps main's fetch age budgets (#5680) and tail ledger (#5802) under the narrowed model: `exemptFetch` is gone, `fetchBudget` stays model-internal, `groupExpired` and `latency_expired` are marked pending the serve quest, and the ledger the session tail reaches is marked pending the ingest quest. `Tail arrivals` landed, so ingest has no blockers left. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Quest:
quest/m1/tail-arrivals.md(deleted here, references repointed).Summary
A received track now judges which groups its pending tail still owes from a per-track record of live arrivals instead of scanning the cache.
TrackState::arrivalsis aLedger(newrs/moq-net/src/model/ledger.rs) of the sequences the live feed delivered, as a group (at its header) or a datagram. Fetched copies never count, and eviction never touches it.tail::TailintoLedgerunchanged, so the session's tail and the track's record give up on a gap by one rule.Tailkeeps its API and delegates.tail::graceof the track's aggregate max delay. Only a write folds (an arrival or an abort), so the end check needs no clock.is_complete) no longer scans the cache:awaits_tailasks the ledger, andwithholdsreads a count of withheld (pending) slots kept in step at every insert, reveal, and removal, with adebug_assertagainst the scan.Decisions (settled by the maintainer)
The maintainer accepted all four on 2026-10-16.
Tailalready gives up on it by the same rule. Alternative: keep such holes and error on abort, which fails a reader for a loss it already skipped and needs unbounded hole storage on a lossy track.Tail(only gaps between runs fold). With a declared start below the first arrival, an abort before the session settles errors readers. Alternative: fold it from the first arrival's time, which reopens questions about a lowered start (Tail::demand).tail::grace(max_delay)), not plumbed from the session. That keeps the model self-contained toward the public received-end API (quest/m1/public-model/ingest.md). IETF's session tail uses the fixedGRACE, so with a nonzero max delay the model may fold sooner than the IETF session settles. The subscriptions lock is taken under the track lock only when a gap exists; it is a leaf lock.quest/m1/public-model/ingest.md. The note added there records that this PR landed the arrival record without a grace timer (a gap folds only on a write, so the session still settles withset_tail_pending(false)), and leaves the public shape to that quest.Public API and wire
Public API: behavior only. A received track whose pending tail is cut off by an abort now ends readers with the abort error instead of a clean end;
poll_completereports it as cut off. Wire: none.Benchmark
New
track_pending_tail(cargo bench -p moq-net --features fuzz --bench tail), re-polling a reader held at a hole, swept over tracks x groups cached above it (short runs on a loaded machine):track_fanout_group/1(local appends, which now record arrivals) stayed within noise (1.136 us vs 1.145 us).Tests
cargo nextest run -p moq-net --tests --features fuzzwith clippy as the wrapper and warnings denied: 2266 passed.cargo nextest run -p moq-relay -p moq-native --tests: 333 passed.cargo check -p moq-net --no-default-features: no warnings.cargo clippy -p moq-net --benches --features fuzz -D warnings: clean.quest check: ok.just test interop(no wire change), JS (untouched).Follow-ups
quest/m1/js-pending-tail.mdis unblocked and now describes the record to mirror, including the short-tail error.quest/m1/resume-reorder.mdis unblocked:poll_group's "passed" verdict can readTrackState::arrivals.finish_atsettles a received tail withoutset_tail_pending(false)(left toquest/m1/public-model/ingest.md).(Written by Claude Opus 5.5)
🤖 Generated with Claude Code