fix(gateway): make in-flight session recovery crash-safe - #67078
fix(gateway): make in-flight session recovery crash-safe#67078StellarisW wants to merge 9 commits into
Conversation
|
Thanks for the focused recovery work. The reported premise is verified on current GitHub reports the branch CLEAN/MERGEABLE, and its base Automated hermes-sweeper review. |
5afd52a to
a192c9c
Compare
a192c9c to
16dc0f8
Compare
What does this PR do?
Makes in-flight gateway recovery crash-safe and deterministic across process death, drain timeouts, and delivery ambiguity.
Root causes
The previous recovery path had several independent gaps:
Implementation
sessions/.active_runs.jsonjournal withsession_key, randomrun_id, trigger message ID, phase, recovery attempts, and controlled-interruption metadata. It stores no user message content.run_idtodelivery_obligationsthrough a backward-compatible additive migration. A confirmed redelivery CAS-clears only the matching active run, so an old reply cannot clear a newer task._finish_startup_restore()call that could abort startup after recovery consumers were initialized.run_idSafety boundaries
run_idare still deliverable, but cannot clear a currently journaled run without exact identity.Type of Change
Validation
Validated after rebasing linearly onto
main@c4f5a45d5d9903998fb318ac6f3c5e6623e60445:ruff checkon all touched recovery files and tests: passed.git diff --check: passed.Compatibility and rollback
Checklist
mainInfographic
Final head
65fac02e2