Skip to content

fix(rust): serve session requests sent during session.create - #2747

Open
costajohnt wants to merge 1 commit into
github:mainfrom
costajohnt:rust-session-fs-during-create
Open

costajohnt wants to merge 1 commit into
github:mainfrom
costajohnt:rust-session-fs-during-create

Conversation

@costajohnt

Copy link
Copy Markdown

With a session fs provider, create_session hangs: the CLI sends sessionFs.readFile while session.create is still in flight, but the session's request channel is only drained by the event loop, which the create path started after the RPC returned. The session was already registered before the RPC, so the request was queued and never answered.

This starts the event loop before the RPC whenever the session id is known up front, which is what resume_session already does. Cloud sessions with a server-assigned id still start it after the response registers the session.

Added session_fs_serves_requests_during_create, which sends sessionFs.readFile before answering session.create. It times out on main and passes with this change. The session::, session_lifecycle:: and session_config:: e2e groups pass.

Two things I left matching resume rather than changing: a capabilities.changed received during create is overwritten by the create result, and explicit error paths stop the early loop through the registration guard's drop instead of awaiting it.

Fixes #2624

Start the session event loop before the session.create RPC when the
session id is known up front, as resume already does, so a
sessionFs.readFile issued while the create is in flight is answered
instead of queued forever.

Fixes github#2624
@costajohnt
costajohnt requested a review from a team as a code owner September 22, 2026 13:12

This branch has not been deployed

No deployments
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.

Rust: create_session deadlocks forever when ClientOptions::session_fs is set — the session's request consumer starts after the session.create RPC

1 participant