Skip to content

fix(net): let resumed subscriber forks follow route swaps - #6024

Merged
kixelated merged 6 commits into
mainfrom
quest/m1/resume-fork
Oct 20, 2026
Merged

kixelated merged 6 commits into
mainfrom
quest/m1/resume-fork

Conversation

@kixelated

@kixelated kixelated commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

A resumed JavaScript subscriber fork stayed on the route serving when it was created. If that route failed during an incomplete group, the fork failed instead of reading the remaining frames from its replacement. This also affected IETF FILL reads.

Approach

Open an independent logical reader on the same route, reusing the parent's reader implementation. The fork starts on a fork of the parent's newest copy, at that copy's generation, so it keeps the retained groups between routes and after the front concludes, then follows later routes like any reader. Cover recovery after the parent closes, independent preferences and replay cursors, cleanup, and shared on-demand requests. The fork comment keeps its reason for not resolving through the broadcast again and notes that a routed fork follows route swaps.

Rust FILL already fetches through the logical track, so it needs no change.

Retires quest/m1/resume-fork.md.

Impact

  • Existing fork behavior follows same-epoch route replacements. No new public symbols, API shape changes, or wire changes.

Alternatives

Forking the serving copy cannot follow replacement routes. Reusing the logical reader avoids a second recovery implementation.

Decisions

No maintainer decision was given; the recommended option was taken. The earlier no-merge hold still stands until the maintainer lifts it.

A finite group-only fork's closed stays pending after recvGroup() EOF. The fork now shares the logical Reader, so it has the same gap every resumed reader has today. Its only caller, the IETF FILL path, always closes its fork explicitly and never awaits closed, so nothing leaks or hangs in practice.

  • ✅ Ship this PR and leave the gap to /quest/m1/resume-closed.md, whose first bullet is exactly this for every resumed reader, forks included. Retire the fork quest.
  • Fix single-channel closure here. Overlaps the [M] resume-closed quest and its end-policy questions.
  • Keep this PR draft until resume-closed lands.

Validation

  • Regression fails on the original implementation with SessionClosed; passes with this change.
  • Merged origin/main; adapted the preferences test to feat(net)!: track demand reports the wanted group, with refresh on join #5930's Demand.wanted (waits through unwanted).
  • Regression for a fork made after Front.conclude() or park() replaying its parent's copy fails without the seeding fix.
  • just check passed at the new head.
  • Extended the existing benchmark over 1/4/16 readers and 0/1/16 swaps. The slope gate passed. Forks measured 17.05–23.56 µs/group on Bun 1.4.2, CPUs 4–7 of a shared 16-core host. These measurements do not establish a speedup.

Follow-ups

(Written by Claude Opus 5.5)

🤖 Generated with Claude Code

kixelated and others added 5 commits October 19, 2026 17:35
Co-Authored-By: GPT-6.1-Sol <noreply@openai.com>
Restore the original quest while finite group-only closure remains unresolved. The implementation and prior source validation remain at caca147.

Co-Authored-By: GPT-6.1-Sol <noreply@openai.com>
The merged main replaced `Demand.unused()` with `wanted`; wait through `unwanted` instead.
Restore the fork comment's reason for not resolving through the broadcast again.
The fork quest is complete: the group-only closure gap it inherits is the existing
`resume-closed` quest's, shared by every resumed reader.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated marked this pull request as ready for review October 20, 2026 05:31
@coderabbitai

coderabbitai Bot commented Oct 20, 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 5 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: 9bdcecc4-156b-48c8-a59e-0a7a70ca01a0
📥 Commits

Reviewing files that changed from the base of the PR and between 8ef6841 and 86efdf9.

📒 Files selected for processing: 6
  • js/net/bench/resume.ts
  • js/net/src/resume.test.ts
  • js/net/src/resume.ts
  • js/net/src/track.ts
  • quest/m1/README.md
  • quest/m1/resume-fork.md
  • 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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 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-20T05:43:05.889392Z 86efdf9 New commits
ℹ️ 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.

@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: e57cc99762

ℹ️ 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 js/net/src/resume.ts Outdated
A fork made between routes or after its front concluded found no route source and ended
with a dropped route, though its parent still held the copy and its retained groups.
Seed the fork with a fork of the parent's newest copy at that copy's generation, then
follow the route as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated added this pull request to the merge queue Oct 20, 2026
Merged via the queue into main with commit d9f94e1 Oct 20, 2026
5 checks passed
@kixelated
kixelated deleted the quest/m1/resume-fork branch October 20, 2026 15:51
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