Repository navigation
fix(net): a finished bounded copy leaves the largest group open - #7053
Conversation
Quest-Claim: 4161d7a8908df5cc
A copy a transport bound cut short finished only its own range, so it no longer marks the track's largest group final. Audits every whole-group versus settled-copy check in the model; the rest already use the meaning they need. 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 7 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. |
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed commit: 1b2a6566c0e9908017d2b2ef5fefc840641b0242.
No actionable bugs found in the changed areas. Gating finish_largest on the existing original_fin preserves the distinction between a settled bounded copy and a known group end without adding another state flag. The regression test exercises the premature-largest-stream termination, and the existing recreated/fetched-whole-copy tests cover the complementary completion path. The teardown change is documentation-only; keeping the separate cut/aborted-copy questions out of this focused fix is reasonable.
Verification: static inspection of the diff and surrounding bound, finish, teardown, largest-stream, and test code via GitHub. I did not run tests or independently verify the reported test results.
|
Merge summary: Review: Codex reviewed head 1b2a656 with no findings, and an automated OpenAI review found nothing actionable. CI is green, and Not done here (follow-ups from the body): (Written by Claude Opus 5.5) |
Problem
Every moq-net check that asks whether a group is done must mean one of two things. Either a copy whose writer finished (
Handle::is_settled), or the whole group reaching its end (is_finished). Three review rounds on moq-dev/moq#6922 each fixed one wrong site. quest/m1/settled-copies.md asks for an audit of every caller at once.One related check was wrong.
group::Producer::finishcallsfinish_largestfor every copy. When a bounded fetch copy of the largest group finished, the largest was marked final even though the group could still grow. On a track whose end was already reached, thelargeststream then ended early.Approach
finishcallsfinish_largestonly for a copy no transport bound cut short. This reuses theoriginal_finthe compressor already computes. A new test,a_finished_bounded_copy_keeps_the_largest_open, failed before the fix.cache::Largest::openandfinish_largestnow say "whole copy".tear_downgets a comment saying its whole-groupopen/retainchecks are deliberate.Audit of
rs/moq-net/src/model/. Every caller other thanfinish_largestalready uses the meaning it needs:TrackState::tear_down, the copies it aborts!is_settledtear_downopen(dropped)!any(is_finished)tear_downlookup.retainany(is_finished)TrackState::set_idle(displaced)!any(is_finished)TrackState::is_settledslot.group.is_settledConsumer::parked_wholeis_finishedwith frame 0Detached::writing!is_settledHandle::abort_open,resume_frame(inlinefin)group::Producer::finish→cache::finish_largestfinSlot::serves_end/is_walked/cut/is_read/is_expired/is_spent, arrival/ordered walks,holds,landing,peek_*, fillcached,miss.rs(filled,settle, refusals,holes),insert_group_request'skeptThe
is_finishedinbroadcast.rs,Window::is_settled, andkio::Pending::is_finishedbelong to other types and are out of scope.Impact
Alternatives
Follow-ups
DropCursor::cutreports a cut that a fetched head covers. It recordsslot.group.cut_error()for any visible slot. A live group the publisher cut, while a fetched whole head still serves its end, is both handed out by the walk (serves_end) and reported as dropped. It could useSlot::cut(), which isNonewhile a copy serves the end. First confirm what a wire subscriber should see. Not changed here: it is about cuts, not settled versus whole.TrackState::is_settledchecks onlyslot.group. A visible slot whose live group was aborted (cut or evicted), while a fetched head kept serving it, keeps the end unsettled. A later abort then turns the clean end into an error. Decide whether an aborted copy counts as "nothing in flight".Validation
cargo test -p moq-net --all-features --lib: 2627 passed. The new test failed before the fix.just check: pass at 1b2a6566c0 (8962 Rust tests and the rest), after merging main.quest check: pass. The finished quest and its link inquest/m1/README.mdare removed.🤖 Generated with Claude Code
(Written by Claude Opus 5.5)