Conversation
|
Thanks for the focused recovery fail-safe. Current main still swallows a recovery finder exception and returns The runtime path does retry recovery after detecting an ended route ( Automated hermes-sweeper review. |
SummaryEight PRs address or reference this session-routing complex: #52808/#54138 implement crash-startup pruning, #54916/#55232/#55485 cover live routing and eviction variants, #62012/#62038 target ended-session resurrection, and #63265 preserves a stale route when recovery lookup is indeterminate. The diffs separate three causes: stale-key creation, recovery that reopens ended rows, and lookup failure being mistaken for a clean no-match. Related pull requests
Duplicates#52808 and #54138 implement substantially the same startup-pruning fix, with #54138 the merged reimplementation. #54916 and #55232 overlap in the older #54878 lane and were superseded by the more general merged #55485; #62038 competes with #62012 but is a partial alternative rather than an equivalent duplicate. Suggested consolidationKeep #63265 open with a salvage path: preserve its narrow exception-versus-no-match distinction and regression test, consistent with the maintainer-bot keep_open verdict. Keep recorded best fix #62012 open with the durable supersession and real-DB first-message test pending contributor re-review; for #62038, author action: rebase onto main, or split out a shared startup/runtime recovery decision that addresses its contributor review, since the current diff only delays reopening. #52808/#54916/#55232 should remain closed, while #54138/#55485 remain relevant merged references. Cross-PR triage: Reviewed 8 pull requests and 3 issues in this complex. Each diff was read against this issue; Assessment working set: 86 kB of PR diffs, 32 kB of issue/PR text, 22 kB of discussion (25 comments), 14 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch. |
Summary
SessionStore._prune_stale_sessions_locked()could delete the only gateway routing entry when startup stale-session recovery hit a transient lookup error.When
sessions.jsonpoints at an ended parent session, startup pruning tries to recover the latest live gateway child through_recover_session_from_db(). If that recovery lookup fails unexpectedly, the current code treats it the same as “no recoverable row exists” and prunes the routing key. That loses the only fast routing handle for the peer, so the next gateway message can mint a fresh empty session instead of retrying recovery.Why
This is the same fail-safe shape as the recent session-state P1 fixes: an indeterminate safety/recovery check should not destroy session routing state.
Keeping the stale entry on lookup failure is safer than deleting it, because the runtime stale guard can retry recovery on the next message. The existing behavior for a clean “no recovery found” result is unchanged.
Changes
raise_on_lookup_errorpath to_recover_session_from_db().Tests