Repository navigation
fix(net): a parked read watches its edge abort - #5159
Conversation
A parked read wakes on its successor and on frame writes crossing its deadline, but not on the edge's abort. Under a timestamp rewind that abort hands the edge to a lower group that already presented past the deadline, and nothing wakes the read. Register on the edge's closure, and re-resolve if its abort already landed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 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 |
|
Grok review of Tight fix: No blocking issues. Non-blocking:
Verdict: MERGE (once CI is green) This is an automated review, not the maintainer's decision |
Main moved the drift wait into TrackState::poll_drifted, so the edge-abort watch now lives there and also covers the resume path. Renames the new test, since main gained a same-named one from the release backport, and says in group.rs that finishing a group does not close it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review (Written by Claude Opus 5.5) |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
Merge summary for
Public API: none. Wire: none. (Written by Claude Opus 5.5) |
Problem
A read parked on its drift budget wakes when its successor gets its first frame or aborts, when a group lands above it, and when a frame write crosses its deadline. It does not wake when the live edge aborts.
Under a timestamp rewind, that abort can change the verdict on its own. Take a head at 0s, its successor at 1s, then a group at 10s, then the edge at 2s, with a 5s budget. The head is within budget against the 2s edge, so the read parks. When the edge aborts, the edge falls back to the 10s group and the head is 9s behind. Nothing wakes the read, though: the abort only closes the group, never touching the track, and the 10s frame was written before the read parked, so no write crosses the deadline afterwards.
#4892 listed this as pre-existing. The review of its release backport (#5130) found a variant there that the narrowed scan made new, and fixing that one also fixes this.
Approach
TrackState::poll_drifted(whichGroupExpiry::is_expiredand the resume path both call) now also registers on the resolved edge's closure, and re-resolves if the edge aborted before registration. That is the same pattern the successor already uses. An aborted group is never the edge again (live_edgeskips it), so each pass resolves a lower group and the loop ends.Finishing a group does not close it, so a finished edge that is later aborted or evicted still wakes the read. The
group.rsdocs onpoll_closed/closedsaid a finish closes the group; they now say it does not.Impact
rs/moq-net/src/model/track.rs;rs/moq-net/src/model/group.rsgets doc fixes only.Tests
a_parked_read_watches_its_rewound_edge_abort(no wall clock). It fails onmain("the edge's abort lost its wakeup") and passes here.just test -p moq-net: 1707 passed, 5 skipped.just checkagainstorigin/main: exit 0 (5692 Rust tests passed, 15 skipped; lint, doc, and the JS and workflow checks clean).Benchmark
track_parked_read, with--warm-up-time 1, criterion medians. The machine was heavily loaded (load average about 69), so these show the shape, not exact costs:The run-to-run noise is larger than any difference, and there is no slope over parked reads. The fix adds one closure registration per poll on the edge group.
Follow-up
On
main,track_parked_readcan panic atbenches/track.rs:457with the default warm-up. Each append advances timestamps by 2.5ms, so a warm-up call of more than about 1.44M iterations moves the edge past the bench's 3600s budget, and the parked reads expire. Whether it panics depends on machine speed. Unchanged code hits it too (it panicked twice before this change). It needs its own fix, for example sizing the budget to the iteration count.(Written by Claude Opus 5.5)
🤖 Generated with Claude Code