Repository navigation
fix(moq-net): a key-order read holding a copy wakes when the owed group lands - #9178
Conversation
Quest-Claim: 25982ae736a21802
…up lands A resumed key-order read leaves a copy's cursor on a group outside its window while the window owes a lower one that may land on that copy. The peek returned the held group, so nothing parked the read on the copy, and it stalled until another event woke it. Register the copy's arrivals before holding, and peek again if one landed. 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 13 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. |
|
Merge pick (maintainer away, granted the coordinator merges it confidently recommends): ✅ /quest-merge, accepting the decisions listed in the PR body. The JS counterpart (whether #9115's (Written by Claude Opus 5.5 with high) |
There was a problem hiding this comment.
✅ No new issues found.
Approach: sound. It parks the held read on the held copy's arrivals, the same way the drained arm already does, so the fix is where the wake was lost and not in a caller.
Reviewed changes: I reviewed the change to the owes_below hold in Reader::poll_lowest and its regression test.
- Held copy registers its arrivals: before
break, the hold callscopy.track.poll_arrived(arrivals, waiter). If a group landed since the pass's snapshot, it refreshesarrivalsand peeks again. Each re-peek needsnext_arrivalto grow, so the loop stays bounded. - Regression test:
a_key_order_read_holding_a_copy_wakes_when_the_owed_group_landsuses a realWakewaiter to check two things: writing group 0 to copybwakes the parked read, and the next poll hands out group 0. - Quest file removed: deletes
quest/m1/resume-owed-wake.md, which this PR finishes.
claude-opus-5-5 | 𝕏

Finishes
quest/m1/resume-owed-wake.md(deleted here).Problem
A resumed key-order read on a front's logical track can leave a copy's cursor on a group outside its window, because the window still owes a lower group that may land on that copy (
Reader::poll_lowest, theowes_belowbreak inrs/moq-net/src/model/resume.rs). The copy's peek had returned the held group, so nothing parked the read on that copy. When the owed group then landed, the read stayed asleep until something unrelated woke it (another copy's group, a route change, a deadline). With the replaced copy dead it stalled until the budget ran out.Approach
Before holding, register the copy's arrivals (
track.poll_arrived), as the drained arm already does. If a group landed since the pass started, peek the copy again with a fresh arrival count, so a group that landed mid-pass is not missed and the loop stays bounded by arrivals.poll_arrivedparks on any change to the copy's track state, so a later skip declaration or failure on that copy also wakes the read, which matters once moq-dev/moq#9115 makesowes_belowdepend on those.Impact
Caused by
owes_belowhold inpoll_lowestwithout parking the read on the held copy (found by reviewer, while killing mutants in moq-dev/moq#9144)Validation
a_key_order_read_holding_a_copy_wakes_when_the_owed_group_lands(the quest's setup with a realWakewaiter) fails onmainat the wake assertion.main: group 0 is inside the local bounds on an open copy that does not skip it, soowes_belowstill holds and nothing parks. So the bug is not gone with fix(net): a JS resumed reader hands out no group outside its window #9115, and this PR proceeds rather than deleting the quest.resume_model.rs,readers_match_the_logical_track), which re-polls only readers whose waker fired, passes 3000 cases each at seeds 1, 3, 7 and 11.cargo test -p moq-net --features async: all pass.just checkpasses.Decisions
main; fix(net): a JS resumed reader hands out no group outside its window #9115 ports it tojs/net/src/resume.ts(#owesBelow,owing). Whether that JS hold wakes when the owed group lands is left to fix(net): a JS resumed reader hands out no group outside its window #9115, which owns that code.Follow-ups
None.
Models
Size: S
Implementer: Claude, claude-opus-5-5, high effort
(Written by Claude Opus 5.5 with high)
Review
Rewritten by
quest reviewafter each round.Head: 9776289
Base: origin/main at 03bfeea
Risk: medium,
the base has no RISK.md to name what is always high or customer-facing, so every change is mediumClassified: medium by default
Reviewer: Codex, gpt-6.1-sol, medium effort
Session:
01a1f42f-5503-7a53-831e-3f510229796d, round 1Score: 9/10,
The change fixes arrival wake registration and covers wake-driven delivery with a regression test; source inspection found no actionable defects, though builds and tests were not run as instructed.Rounds: 1; first round 0; findings 0: fixed 0, refuted 0, open 0
Findings: none