Skip to content

fix(net): stop a stalled group read spinning on closed routes - #6690

Merged
kixelated merged 1 commit into
mainfrom
fix/resume-wants-closed-route
Oct 25, 2026
Merged

kixelated merged 1 commit into
mainfrom
fix/resume-wants-closed-route

Conversation

@kixelated

Copy link
Copy Markdown
Collaborator

Problem

Recover::wants in rs/moq-net/src/model/resume.rs loops while poll_changed is ready. poll_changed maps a closed route state (kio Ref error) to Ready. When the routes close without setting end or concluded, and a reader is stalled mid-group on the same copy, the loop never exits: one worker spins at 100% CPU inside a single poll, from GroupServe::poll_serve through group::Consumer::poll_resumed into wants. A runtime waiting on that task never shuts down. It came in with #6224.

Approach

Treat route.is_closed() like concluded in the loop's exit check, as Recover::poll and end() already do. A closed route then reads like a conclusion: the reader parks on the copy it is reading and finishes the group from it.

Regression test a_stalled_group_parks_when_the_routes_close: a reader stalled mid-group, routes dropped, then the read is pending, and the group finishes from the original copy. Without the fix, kio's sim poll budget panics with "Ready poll limit exceeded" at poll_changed.

Impact

  • No public API or wire change.

Alternatives

  • Make poll_changed return Pending on a closed state: it would then never wake for a closed route, and poll's own closed check relies on it waking.

Follow-ups

  • None.

just ci passes on 558d633.

(Written by Opus 5.5)

🤖 Generated with Claude Code

Recover::wants polled the route state in a loop until it was pending, but
a closed route state stays ready forever. A reader stalled mid-group when
its routes closed without concluding spun inside one poll. Treat closed
routes like a conclusion, as Recover::poll and end() already do.

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

chatgpt-codex-connector Bot commented Oct 24, 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-24T21:43:05.508288Z 558d633 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.

@coderabbitai

coderabbitai Bot commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 49cfefd6-02de-4f45-9635-f8eedb19818f
Commits

Reviewing files that changed from the base of the PR and between 8ee7728 and 558d633.

Files selected for processing: 1
  • rs/moq-net/src/model/resume.rs

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review.

Walkthrough

Recover::wants now treats a closed route as a completed wait condition, alongside an explicit end or conclusion. A new async regression test checks that a stalled group remains readable from its existing producer after routes are dropped, then reads the remaining frame and end.

Priority: Normal

Merge Risk: Minimal · up to 558d6

The change addresses the stalled closed-route shutdown issue without identifying a remaining merge-blocking risk.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title names the main change: a stalled group read spinning on closed routes is fixed in the net crate. It matches the raw summary, which says Recover::wants now treats a closed route as a complete…
Description check Passed The description covers the problem, the approach, a regression test, the impact, and alternatives. It names the same file, function, and test as the raw summary. It is directly related to the changese…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: a stalled group read spinning on closed routes is fixed in the net crate. It matches the raw summary, which says Recover::wants now treats a closed route as a completed wait condition, and the PR objectives, which describe exiting the polling loop when route.is_closed(). The title is specific and follows the conventional commit style.

Full details: Description check

Explanation

The description covers the problem, the approach, a regression test, the impact, and alternatives. It names the same file, function, and test as the raw summary. It is directly related to the changeset.

Finishing Touches
✨ Simplify code
  • Commit to this branch
  • Create a new PR
  • Autofix · 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
kixelated added this pull request to the merge queue Oct 24, 2026
Merged via the queue into main with commit 1092357 Oct 25, 2026
9 checks passed
@kixelated
kixelated deleted the fix/resume-wants-closed-route branch October 25, 2026 00:06
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