Skip to content

feat(id): coordinate concurrent world sessions (#3845) - #3896

Merged
dezren39 merged 5 commits into
mainfrom
queue/5831-3845-concurrent-world-sessions
Nov 2, 2026
Merged

dezren39 merged 5 commits into
mainfrom
queue/5831-3845-concurrent-world-sessions

Conversation

@dezren39

@dezren39 dezren39 commented Nov 1, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Record the F13.8 session-coordinator design before implementation.
  • Implement concurrent sessions across worlds and server endpoints while preserving client-only behavior and journal invariants.

Refs #3845

Draft: implementation and targeted verification are still in progress.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

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 53 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: bfe9b62c-2bd1-4a93-b2ff-fab795abb634
Commits

Reviewing files that changed from the base of the PR and between c84bbcf and 0ccd459.

Files selected for processing: 2
  • doc/2026-11-01T17-54-35Z_design_id_concurrent_world_sessions/2026-11-01T17-54-35Z_design_id_concurrent_world_sessions.md
  • pkgs/id/src/world_net.rs
  • 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

@dezren39
dezren39 marked this pull request as ready for review November 2, 2026 16:45
@dezren39
dezren39 requested a review from a team as a code owner November 2, 2026 16:45
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 2, 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-11-02T19:17:21.078533Z 90af65a 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: f1549d0903

ℹ️ 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 pkgs/id/src/world_net.rs
Comment on lines +1262 to +1264
if !self.roots.contains_key(&key.0) {
let root = WorldClient::connect(&self.endpoint, addr).await?;
self.roots.insert(key.0.clone(), root);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Replace closed root connections when reopening a session

After a server disconnects or restarts, its closed connection remains in roots. Even if the caller removes the failed session with close_session and calls open_session again, this membership check skips reconnecting, so WorldClient::open_session keeps attempting open_bi on the permanently closed connection. The only available recovery is close_all, which also disconnects healthy sessions on unrelated servers. Detect and replace closed roots, invalidating their associated sessions, so one endpoint can recover independently.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in ec840e9 (pushed to this branch): WorldSessions::open_session now evicts a closed root — detected via a new WorldClient::is_closed (conn.close_reason().is_some(), the idiom already used in repl.rs) — together with every session keyed to that endpoint, before the membership checks, so the endpoint redials independently instead of wedging until close_all. Regression test coordinator_replaces_a_closed_root_connection_on_reopen covers exactly your scenario (root dies → close_session → open_session succeeds on a fresh root).

Verification caveat, stated plainly: the targeted tests cannot run on the current branch base yet — the base does not compile pkgs/id (references.rs E0277/E0597, the breakage PR #4477 restores; an E0599 on addr.id() also fires on this PR's pre-existing Self::key at the same base). Task 5831 is parked to rebase onto post-#4477 main and run cargo test -p id --lib world_net::tests::coordinator before merge; the PR will not merge unverified.

@dezren39
dezren39 force-pushed the queue/5831-3845-concurrent-world-sessions branch from f1549d0 to da895b5 Compare November 2, 2026 17:07
)

Codex P2 on PR #3896: a root connection that closed (server restart)
stayed in WorldSessions.roots forever; after close_session, open_session
skipped redialing on the membership check and kept attempting open_bi on
the dead connection, so one endpoint could only recover via close_all,
which also drops healthy sessions on other servers.

WorldSessions::open_session now evicts a closed root (detected via
WorldClient::is_closed, the close_reason idiom from repl.rs) together
with every session keyed to its endpoint before dialing, so the
endpoint redials independently. Regression test
coordinator_replaces_a_closed_root_connection_on_reopen covers
close_session + reopen after the root dies.

Verification status: targeted tests cannot run yet — the branch base
does not compile pkgs/id (references.rs E0277/E0597, the breakage PR
#4477 restores; world_net.rs E0599 addr.id() also fires on the PRs
pre-existing Self::key at the same base). Rebase onto post-#4477 main
and rerun cargo test -p id --lib world_net::tests::coordinator before
merge (task 5831 park note).
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