Auto reconnect server side - #5788
Open
aasoni wants to merge 2 commits into
Open
Conversation
aasoni
force-pushed
the
alessandro/auto-reconnect-server-side
branch
5 times, most recently
from
August 26, 2026 09:39
9d2f341 to
391006b
Compare
Contributor
Author
|
The riskiest changes are probably in module_subscription_actor and are the following:
This allows batched subscriptions to hash queries outside of the tx lock and then compile them all under the same lock. |
aasoni
force-pushed
the
alessandro/auto-reconnect-server-side
branch
2 times, most recently
from
August 26, 2026 11:35
3478af8 to
7ba085d
Compare
Adds the two server-side changes needed for SDK auto-reconnect (proposal 0037). Connection replacement: a client which reconnects can now send a stable, client-generated `session_id` query parameter. Each connection still gets its own ConnectionId and its own lifecycle events. The session id only identifies which earlier connection a new one supersedes. When a connection claims a session held by a live connection of the same identity, that connection's actor is stopped and its module-side disconnect lifecycle is awaited before the new connection's client_connected, so a module never observes two live connections for one session, nor the old connection's client_disconnected after the new client_connected. Batch subscribe: SubscribeBatch and SubscribeBatchApplied register multiple query sets under one subscription-manager lock and evaluate them at a single transaction snapshot. No transaction update can interleave with the responses, so a reconnecting client can replay its subscriptions and reconcile its cache against a consistent snapshot. Per-set errors are reported in the response and the remaining sets still apply
aasoni
force-pushed
the
alessandro/auto-reconnect-server-side
branch
from
August 26, 2026 15:39
7ba085d to
1ce785b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Changes
Auto-Reconnect: Connection replacement and batch subscribe
Adds the two server-side changes needed for SDK auto-reconnect (proposal 0037).
Connection replacement: a client which reconnects can now send a stable, client-generated
session_idquery parameter. Each connection still gets its own ConnectionId and its own lifecycle events. The session id only identifies which earlier connection a new one supersedes. When a connection claims a session held by a live connection of the same identity, that connection's actor is stopped and its module-side disconnect lifecycle is awaited before the new connection's client_connected, so a module never observes two live connections for one session, nor the old connection's client_disconnected after the new client_connected.Batch subscribe: SubscribeBatch and SubscribeBatchApplied register multiple query sets under one subscription-manager lock and evaluate them at a single transaction snapshot. No transaction update can interleave with the responses, so a reconnecting client can replay its subscriptions and reconcile its cache against a consistent snapshot. Per-set errors are reported in the response and the remaining sets still apply.
API and ABI breaking changes
No API breaking change. New V3 websocket protocol message. New clients will not be able to send this to old servers.
Expected complexity level and risk
3 - Primarily because of the changes in module_subscription_actor.rs
Testing