mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-16 23:52:40 -06:00
319a796079
A failed, refused, superseded, or thrown restart emission could leave the reversible restart-signal admission fence closed forever: concurrent emitters could overwrite the live rollback lease with a dead stand-in, the fenced body had no try/finally, and the outer catch swallowed errors precisely because the stuck fence made isGatewayRestartDraining() true. The gateway then rejected every new task with GatewayDrainingError - silently - until an operator restarted the process. beginGatewayRestartSignalAdmission now returns null instead of stand-in leases (single fence owner), emitPreparedGatewayRestart reopens the fence on every non-delivery path via try/finally while preserving it whenever a queued SIGUSR1 is unconsumed, refused-signal cleanup force-clears orphaned fences, and admission close/reopen transitions are logged with their reason. The self-contained SQLite restart-intent persistence moves to restart-intent.ts to keep restart.ts within the LOC ratchet. Fixes #107322