Skip to content

fix(net): a FETCH never stalls on a parked open group - #5365

Merged
kixelated merged 1 commit into
releasefrom
quest/m1/release-warm-fetch
Oct 13, 2026
Merged

kixelated merged 1 commit into
releasefrom
quest/m1/release-warm-fetch

Conversation

@kixelated

@kixelated kixelated commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

On the 0.17 line, a FETCH of a group that a live subscription delivered only in part, after that subscription went idle, returns the cached frames and then hangs forever (#5348). When the last reader leaves mid-group, the front parks a warm copy (warm_copy/warm_rebuild in model/origin.rs) that rebuilds the open live-edge group, and nothing writes to it again. resume::Consumer::cached_group served that open copy as a FETCH hit, and no upstream SUBSCRIBE or FETCH followed.

Seen downstream as a recorder restarted within the cache window permanently stalling a rendition.

Approach

Per quest/m1/release-warm-fetch.md on main:

  • An unfinished group in a warm segment is a FETCH miss (cached_group takes a finished flag, set for warm segments).
  • Fetching::poll_latch never latches a warm segment. The pending fetch holds demand, the front re-splices, and the FETCH goes upstream on the new copy.

Regression: rs/moq-net/tests/idle_cancel_refetch.rs drives it over a lite-06 mock session. It fails on release with group 1 hangs: Elapsed and passes with the fix.

Impact

  • Public API: none. Wire: none.

Alternatives

Follow-ups

Closes #5348

(Written by Claude Opus 5.5)

🤖 Generated with Claude Code

When the last reader leaves mid-group, the front parks a warm copy that
rebuilds the open live-edge group, and nothing writes to it again. A
FETCH answered from that copy got the cached frames and then waited
forever. An unfinished group in a warm segment is now a FETCH miss, and
a fetch never latches onto a warm segment, so its own demand re-splices
the track and the FETCH goes upstream on the new copy.

Release only: main deleted the warm copy in #4741.

Closes #5348

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-12T20:34:55.184840Z 9a50b9f PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@kixelated kixelated left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review by review (OpenAI)

Reviewed commit 9a50b9f against release (0393334).

No actionable bugs found. The two guards address both ways a FETCH could get stuck on the parked copy: cached incomplete groups miss, and upstream requests wait for a live replacement. Finished cache hits remain available, and the existing demand lifetime supplies the re-splice. This is a suitably narrow fix that preserves live subscribers' open-group continuation.

Inspected all three changed files and surrounding cache, demand, park/takeover, group-completion, and mock-session code. Verification was static through GitHub; I did not execute tests. CI was still running when checked, so this does not establish a test pass.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9a50b9f273

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

Comment thread rs/moq-net/tests/idle_cancel_refetch.rs
@kixelated

Copy link
Copy Markdown
Collaborator Author

Merge summary:

  • An unfinished group in a parked warm segment is now a FETCH miss, and Fetching::poll_latch never latches a warm segment, so the FETCH waits for the re-splice and goes upstream instead of stalling after the cached frames.
  • Regression rs/moq-net/tests/idle_cancel_refetch.rs fails on release without the fix.
  • OpenAI review: no findings. Codex P1 (move the test inline) resolved per the reply above: it is a full-session test over the shared mock harness, and release already keeps ~25 such files under rs/moq-net/tests/.
  • No API or wire change. Merging into release with a merge commit; test(net): a group cut by an idle cancel is refetched whole #5366 lands the main guard and retires the quest.

(Written by Claude Opus 5.5)

@kixelated
kixelated merged commit 1c65161 into release Oct 13, 2026
7 checks passed
@kixelated
kixelated deleted the quest/m1/release-warm-fetch branch October 13, 2026 01:13
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