Commit graph

2 commits

Author SHA1 Message Date
Peter Steinberger
10c229159c
fix: forced Gateway restarts cancel healthy subagent work (#154300)
* fix: let forced Gateway restarts drain admitted work

Keep force separate from exhausted drain budgets and settle startup orphan rows with their failure receipts in one transaction. Reuse prepared process fixtures for restart coverage.

* test: include drain budget in external restart health check

Preserve the exact running-Gateway and no-candidate-state assertions while allowing the existing five-minute drain budget before the one-minute readiness window.

* test(gateway): control elapsed drain clocks

* refactor(gateway): separate restart budget and warning formatting

* fix(gateway): retain shutdown deadlines through completion

Integrate the landed shutdown-completion owner fix from #145241 so its
extracted regression suite composes with the forced-restart drain policy.
Keep the cleanup-only fixtures explicitly exhausted and preserve their
original timeout assertions.

Co-authored-by: Alex Markson <alex@metahack.io>
Co-authored-by: Vincent Koc <vincentkoc@ieee.org>

* test(gateway): clean up forced restart fixtures

---------

Co-authored-by: Alex Markson <alex@metahack.io>
Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
2026-09-21 04:28:38 -07:00
Peter Steinberger
2ce0573b02
fix(gateway): preserve active work during recovered Node restarts (#153435)
* fix(gateway): preserve work during recovered Node restarts

Let Unix Node recovery wrappers respect the existing Gateway stop budget.
Share startup-safe command classification and deadline facts, and resolve
managed restart intent against the live serving owner in its write
transaction with current update authority.

Preserve the existing public PID intent API, record format, and Windows
behavior. Keep cold lifecycle test preparation outside timed hooks.

Inspired by @ly85206559's wrapper-grace approach in #147054; this repair
is independently authored from main. Related: #146956. Windows cooperative
shutdown remains a follow-up.

* refactor(gateway): stabilize restart callback and test setup

Declare receiver-independent restart intent callbacks as arrows and retain typed signal spy handles for lint-safe assertions. Move cold lifecycle imports into test collection so worker preparation cannot consume timed setup hooks.
2026-09-19 22:41:17 -07:00