Repository navigation
fix(net): fail an idle copy whose route answers behind its cache - #8041
Conversation
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>
|
@kixelated The body lists one open decision: our moq-transport publisher answers with no Largest when its newest group is unreadable, which this change turns into a failure downstream. Fix it here or as a follow-up? Checked end to end against moqxr v0.4.15 (drafts 18 and 22): the resumed catalog fetch now fails with (Written by Claude Opus 5.5) |
…able A moq-transport publisher whose newest group cannot be read, such as one its upstream reset, answered with no Largest while it still held earlier groups. With the behind-the-cache check, that failed a downstream relay's lingering copy with MALFORMED_TRACK. Report the last held object instead, keeping the subscription past the newest group. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…efused Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…bject ID The answer was judged against the cache at the time it arrived, which on moq-transport already holds the next feed's resent groups, and by frame count, which is not a sparse group's newest object ID. Snapshot the held position at idle, using the wire's object ID where the group has one. 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 17 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. |
|
@michaelstuurman Thanks for checking this end to end. The maintainer's decision on the open question: ✅ fix it in this PR. I pushed it here, along with two fixes the cross-vendor review found:
(Written by Claude Opus 5.5 with medium) |
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed f342773.
No actionable findings. Snapshotting the ended feed's held position after removing open groups avoids judging an answer against data that races ahead of it. Sparse moq-transport groups use object IDs rather than frame counts, and older lite versions retain the separate, non-judging first-group path. Clearing the cache before returning MalformedTrack fits the fail-loud policy without draining stale content. The publisher's fallback Largest preserves held history while keeping the next-object floor beyond the unreadable newest group.
Verification limits: GitHub-only static review of all nine changed files and surrounding live-edge and subscriber teardown logic. No tests, builds, relay interoperability or timing reproduction run. The same-name publisher restart and reused-alias races remain the documented separate limitations. Rechecked open/non-draft state, full head/base and published reviews immediately before posting.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Idle-feed snapshot —
Feed::Idlecarriesheld, the newest object the ended feed left, taken after open groups are displaced so the next feed's resent groups cannot race the answer. - Answer judging —
TrackState::judgefails a resumed copy withMalformedTrackon a missing Largest or one beforeheld, evicting the cache first;set_live/set_live_aheadnow report it andset_live_fromkeeps the lite <07 first-header path unjudged. - Object-level comparison —
group::Handle::last_objectuses the wire's object ID where a group carries one, matching how the IETF subscriber buildsPositionfromLargest.Object. - Teardown on both wires —
ServeEnd::Invalidaborts the copy on moq-transport, and the liteGiveBackpath does the same without escalating the session. - Publisher fallback —
cached_edgeanswerslargest_before(latest)when the newest group is unreadable, keepingnextpast that group, so a downstream lingering copy over earlier groups resumes instead of failing; the draft-22 fetch test now expects INVALID_RANGE past the held Largest. - Tests — model tests for behind/current answers, empty newest groups, the displacement race, and sparse object IDs; integration tests for the empty answer failing the lingering copy and the reset-newest-group relay chain.
I also ran the new tests (cargo test -p moq-net --lib --features async, cargo test -p moq-net --features async --test integration answer_behind) and mutation-checked the publisher change: reverting the _ arm to largest: None makes both a_reset_newest_group_answers_the_group_before_* tests fail with MalformedTrack, so the test genuinely pins the fix.
deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed c178fcd, incrementally from f342773 on the unchanged base.
No new actionable findings. Gating the sparse-object regression on async matches the feature gate on group::Producer::set_wire, which the test calls. The other idle-copy regressions remain enabled without that feature, and the production answer/cache behavior is unchanged. This is a focused fix for the no-async test build rather than a weakening of the object-ID assertion where its wire setup is available.
Verification limits: GitHub-only static review of the one-line update, complete regression and set_wire feature gate. No feature-matrix builds or tests run. Rechecked open/non-draft state, full head/base and published reviews immediately before posting.
main made Hop crate-private, so the answer_behind_cache test takes the public origin::Config::new(NonZeroU64) like the other integration tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Problem
An idle track copy that resumed on a route answer with no Largest hid its cache behind a live floor, while
claim_sequencestill refused the feed's re-sent groups asDuplicate. Live readers stalled until the feed passed the old newest group, forever for a one-group catalog.Approach
Fail loud, as decided in #7973. When an idle copy resumes and its route's answer (lite-07 SUBSCRIBE_START or moq-transport SUBSCRIBE_OK) is behind its cache,
set_live/set_live_aheaddrop the cache and returnError::MalformedTrack. Behind means no Largest while the copy held an object, or a Largest before the newest object it held. What it held is snapshotted when the copy goes idle, after the groups in flight are displaced, so groups the next feed resends before its answer is judged do not count; the object is the moq-transport object ID where the group carries one, else the frame index. An empty group holds no object, so it is skipped. The subscribers fail the copy through their existing teardown: readers get the stream-scopedMALFORMED_TRACK, and the next subscribe builds a fresh copy that accepts the feed from group 0.Our moq-transport publisher now answers the last held object as Largest when its newest group cannot be read (the
_arm ofcached_edgeinietf/publisher.rs), instead of no Largest. That happens on a relay whose upstream reset its newest group while its copy stayed live; before, the downstream relay's lingering copy over the earlier groups would have failed withMALFORMED_TRACK.nextstays past the newest group (latest + 1, object 0), so nothing strands.live_edgestill prefers an upstream report only when it is past this cached Largest, and a Relative filter now counts from the held Largest rather than the unreadable group.Two choices beyond the quest:
set_live_from) and is not judged, since a resend of the cached head would read as behind.Impact
MALFORMED_TRACKwhere it used to stall its readers.Decisions
/quest-complete: report the last held object, as the arm above already does throughlargest_before, keepingnextpast the newest group.Alternatives
Caused by
Follow-ups
Validation
just civiaquest gateon 874bc8a: passed (10996 tests); again on f342773 after the review fixes (10998 tests). It first caughta_draft22_fetch_past_the_largest_object_is_refused, which expected an aborted newest group to leave Largest unknown; it now expects INVALID_RANGE past the held Largest.a_reset_newest_group_answers_the_group_before_*) fails with the publisher change reverted (the upper relay answers no Largest and the lingering copy fails) and passes with it; the unit testan_aborted_newest_group_leaves_the_earlier_largestlikewise.Models
Size: S
Implementer: Claude Code, Claude Opus 5.5, unknown effort
Implementer: Claude Code, Claude Opus 5.5, medium effort
Review
quest reviewcould not read this record and printedrecord skipped; this section is written by hand).01a1b86f-f1cb-7211-a304-2c32cffe4d5c, following session01a1b85d-f3cb-7d62-a8b3-3a73b7dedbfdround 1.rs/moq-net/src/model/track.rs:2901Judge only content retained from the previous feed: on moq-transport the answer is judged after the next feed's head arrives, so a resent in-flight group read as held past the answer. Fixed:set_idlesnapshots the held position after displacing groups in flight (Feed::Idle { held }), andjudge()uses it.rs/moq-net/src/model/track.rs:2907Compare IETF Largest against object IDs rather than frame counts. Fixed:group::Handle::last_object()reads the wire's last object ID when present, asgroup::Consumer::last_objectdoes for the publisher's answer./code-review(Claude Opus 5.5, high) on a450141 fixed an empty newest group read as cached (b911760); merging theset_livevariants and replacing eviction throughevict_groupwere left for the reviewer and not raised by Codex.Closes #7973. Implements
quest/m1/answer-behind-cache.md, removed here.(Written with Claude Opus 5.5)
(Written by Claude Opus 5.5 with medium)