Skip to content

fix(net): wake parked reads when stamped successors abort - #4710

Merged
kixelated merged 3 commits into
mainfrom
quest/m1/parked-read-wakes
Oct 3, 2026
Merged

kixelated merged 3 commits into
mainfrom
quest/m1/parked-read-wakes

Conversation

@kixelated

@kixelated kixelated commented Oct 2, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

A read parked at a group's tail can sleep through a stamped successor's abort. Under a timestamp rewind, that abort changes the group's presentation reach and should wake the reader to re-judge its drift budget.

Approach

Watch the immediate successor's closure before judging a plain group's reach, and watch closure alongside its first timestamp when resolving a resume successor. Add mock-time regressions for plain and resumed stamped-successor aborts, plus an actual cache-GC eviction before the successor's first frame. Remove the completed quest and its references. Add a parked-read benchmark swept over cached groups and readers.

Impact

  • Public API: none.
  • Wire: none.

Validation

  • Before the fix: both stamped-successor abort wake assertions failed; actual GC eviction already passed.
  • After the fix: all three focused regressions pass; the exact-head moq-net suite passes 1,498 tests (4 skipped), exit status 0.
  • Merged current main (after the trunk flip) cleanly; quest check passes and CI re-ran on the merge.

Alternatives

Waking the whole track on every group abort would broaden notifications and ownership coupling. Registering the affected reader directly preserves the existing group-local wake path.

(written by GPT-6, updated by Claude Opus 5.5)

kixelated and others added 2 commits October 1, 2026 22:29
Co-Authored-By: GPT-6 <noreply@openai.com>
Co-Authored-By: GPT-6 <noreply@openai.com>
@kixelated

kixelated commented Oct 2, 2026 •

Copy link
Copy Markdown
Collaborator Author

Implemented at ab385775f5d7cc7895758fc465faaf6ff90a7c70.

Both stamped-successor abort tests reproduced lost wakes before the fix, then passed after registering for closure. The mock-time test using actual cache GC eviction already passed and adds regression coverage. All three focused regressions pass, and the exact-head full moq-net suite passes 1,498 tests (4 skipped), exit status 0. Public API: none. Wire: none.

The exact-head parked-read benchmark comparison, quest validator, just check, and loom checks continue in a detached pinned-Nix process. Their results are pending, so this PR remains a draft. Recommended next step: collect those results and review before /quest-merge.

(written by GPT-6)

@kixelated
kixelated changed the base branch from release to main October 2, 2026 22:03
@kixelated
kixelated marked this pull request as ready for review October 3, 2026 15:59
@coderabbitai

coderabbitai Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You'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 29 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b6dff0d1-36cd-4c47-84da-327bb43326c8
📥 Commits

Reviewing files that changed from the base of the PR and between 5fc2b57 and 7344895.

📒 Files selected for processing (6)
  • quest/m1/2991-net-coalesce-dynamic-tracks-and-preserve-sequences-across.md
  • quest/m1/README.md
  • quest/m1/parked-read-wakes.md
  • rs/moq-net/benches/track.rs
  • rs/moq-net/src/model/resume.rs
  • rs/moq-net/src/model/track.rs
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@kixelated

Copy link
Copy Markdown
Collaborator Author

Merging as approved by the maintainer, as is.

Auto-merge enabled on 73448950967417cd8aa805c25000e708638a01e8.

(Written by Claude Opus 5.5)

@kixelated
kixelated enabled auto-merge (squash) October 3, 2026 16:24
@kixelated

Copy link
Copy Markdown
Collaborator Author

Review (head 73448950967417cd8aa805c25000e708638a01e8)

Fixes a real lost-wake: a stamped successor can abort without mutating the track, so a reader parked on poll_timestamp alone never re-ran. Registering poll_closed in poll_first_start (resume successors via Successor::poll_start) and in GroupExpiry (plain same-track reach) matches the failure mode. The three regressions pin plain stamped abort, resume stamped abort, and GC eviction; quest removal is complete on this head.

Blocking

None in the diff.

Non-blocking

  1. CI still pending on this head (Check / Test / Quest / WASM / Android / Windows / macOS all pending at review time; Auto-merge skipping). Re-check before merge.
  2. GroupExpiry vs poll_first_start abort-race asymmetry (rs/moq-net/src/model/track.rs ~3371–3376 vs ~2592–2600). poll_first_start while-loops when the group aborts between first_servable and the check, so the next servable successor is registered in the same poll. GroupExpiry always poll_closeds once then judges: if poll_closed is already Ready (abort won the race before registration) and the new reach still leaves the held group within a non-zero max_age, the next successor is not watched until something else wakes the reader. With default max_age == 0 this is mostly academic (shrinking reach expires). Mirroring the while-loop (or re-registering when poll_closed is Ready && aborted) would close the gap for non-zero budgets.

Quest / claims

  • Goal covered: stamped successor abort wakes plain + resume; eviction-before-first-frame regression present.
  • quest/m1/parked-read-wakes.md deleted; README + #2991 Related links cleared on this SHA.

MERGE

This is an automated review, not the maintainer's decision
(Written by Grok)

@kixelated
kixelated merged commit 7e6fd81 into main Oct 3, 2026
8 checks passed
@kixelated
kixelated deleted the quest/m1/parked-read-wakes branch October 3, 2026 17:41
kixelated added a commit that referenced this pull request Oct 10, 2026
fix(net): parked group expiry no longer walks the backlog (backport #4710, #4892)
@moq-bot moq-bot Bot mentioned this pull request Oct 10, 2026
kixelated added a commit that referenced this pull request Oct 10, 2026
Conflicts are release backports whose originals are already on main
(#4840, #4892, #4710, #5077) and release's noq 1.3.5 pins (#5170);
resolved to main's side. Ports the two release-only test additions from
the backport reviews: a_parked_read_watches_its_edge_abort, which passes
on main's reworked expiry path, and the capped-group END_OF_GROUP
asserts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
shermerL pushed a commit to shermerL/moq that referenced this pull request Oct 10, 2026
Co-authored-by: GPT-6 <noreply@openai.com>
(cherry picked from commit 7e6fd81)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant