fix(server): correct VSR client session routing and lifecycle#3407
fix(server): correct VSR client session routing and lifecycle#3407numinnex wants to merge 5 commits into
Conversation
Codecov Report❌ Patch coverage is ❌ Your patch check has failed because the patch coverage (3.07%) is below the target coverage (50.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## master #3407 +/- ##
=============================================
- Coverage 74.42% 50.23% -24.20%
Complexity 943 943
=============================================
Files 1231 1234 +3
Lines 120911 107430 -13481
Branches 97645 84194 -13451
=============================================
- Hits 89994 53971 -36023
- Misses 27958 50764 +22806
+ Partials 2959 2695 -264
🚀 New features to boost your workflow:
|
hubcio
left a comment
There was a problem hiding this comment.
a few findings landed on unchanged context lines, so they couldn't be attached inline - noting them here:
-
login_register.rs:47-InvalidClientIdis never constructed in production (only the enum def, theTryFromarm and a test). the client_id==0 path it documents is rejected upstream by the header validation and would hit theassert!(client_id != 0)first. reads like deliberate non_exhaustive scaffolding, but if it isn't pinning a future contract it can go. -
login_register.rs:104- the doc onTryFrom<&LoginRegisterError> for EvictionReasonsays 'no production caller yet', butsurface_login_failurecalls it via.is_ok()on the live login/register branches. just drop the stale claim. -
login_register.rs:97- thatTryFrommapping is only consumed via.is_ok()today; afn is_terminal(&LoginRegisterError) -> boolwould do the same and save the mapping plus theNotEvictabletype. documented as scaffolding for the eviction-frame dispatcher though, so fine to keep if that's landing soon. -
session_manager.rs:250-get_connection/connection_for_client/bound_count/connection_counthave no production callers (tests only), andconnection_for_client's 'for routing consensus replies' doc is obsolete now that the home shard routes by transport id. safe to delete - keep theclient_to_connectionmap itself,bind_sessionstill needs it. pre-existing, not introduced here.
|
/ready |
Drop replicated sessions cluster-wide on disconnect. A lost connection now routes a synthetic
Logoutto the metadata owner, so the replicated session slot is released everywhere instead of lingering until peereviction.
Mutate the SessionManager only after the register commits. Login/register no longer flips the connection to
Authenticatedbefore submit (with rollback on failure); it submits, awaits the commit (post-quorum),then transitions
Connected → Boundin one step. A transient submit failure leaves the connection untouched and the SDK replays.Split the
bootstrap.rsinto focused modules —wire,pat,responses,auth,dispatch— leavingbootstrap.rswith cluster boot/recovery/startup only. The request handlers, owner-forwarders(
submit_*_on_owner), wire-response builders, and credential verification now live next to each other.