Repository navigation
fix: finish process-owned shutdown within its cleanup deadline - #187090
Merged
Merged
Conversation
Bound native wrapper cleanup by the existing host deadline while preserving embedded joins and fatal close failures. Name retained sidecar owners, keep terminated-subagent cleanup under its caller, and commit deployment suspension handoffs before the native stop. No configuration or persisted data changes.
Contributor
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. |
steipete
added a commit
that referenced
this pull request
Oct 29, 2026
b8c02c5 removed an incidental maintenance await, which exposed a race in the cron failure-alert notification tests; they now wait for the real fallback receipt before asserting acceptance, execution and routing. Separately, #187090 edited the module-isolation mocks in the Gateway shutdown and spawn-broker tests, which invalidated their grandfathered mock-exports baseline entries and failed the baseline ratchet for every PR; those mocks now carry explicit mock-isolation reasons and the stale baseline entries are pruned. Production is unchanged.
steipete
added a commit
that referenced
this pull request
Oct 29, 2026
The subagent registry supersession test still asserted a nested Gateway root operation that #187090 deliberately removed (red on main as `0 > 0`). Remove only the obsolete root-counter assertions; keep the overlapping-successor setup and the lifecycle-overwrite assertions. Test-only (+1/-7), no runtime change. Local: subagent-registry.test.ts 77/77 on the exact head. The only failed check was a superseded PR-body format run; its rerun passed.
roboclaw-bot
added a commit
that referenced
this pull request
Oct 29, 2026
#187090 reshaped the shutdown and spawn-broker test mock factories without updating the mock-export ratchet, so their grandfathered entries no longer matched and every pull request merged with main failed the ratchet. These factories intentionally keep the real modules unloaded: the shutdown test records which runtime modules preparation loads, and the spawn-broker test replaces core startup to observe only broker and admission ownership. Mark them with mock-isolation reasons and prune the stale baseline entries. Co-authored-by: hannesrudolph <[email protected]>
This was referenced Oct 29, 2026
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Oct 29, 2026
…law#187090) Process-owned Gateway shutdown now finishes within its cleanup deadline: - The Linux wrapper's database-admission, read-only-worker and spawn-broker close runs under the process-owning shutdown deadline (exitAfterClose only); embedded close still joins fully. - Timed-out cleanup steps name the retained owner (step plus sidecar or callback), so the next forced kill identifies it. - Subagent cleanup no longer goes through admission after it closes (12 handled "Gateway is shutting down" errors per shutdown). - The Team deploy controller commits the maintenance handoff before service stop (gateway.suspend.handoff commit:true, supported by the deployed d87c507), so the 45 s drain lease cannot expire and reopen admission before the stop. - The native hard-exit watchdog arithmetic was verified correct and left unchanged. Root cause and evidence: two Team stops on 2026-10-28 ran ~90 s and ended in systemd SIGKILL, waiting on an unbounded lifetime-sidecar stop, received-connection work, and an armed-but-uncommitted handoff. Proof at exact head 805831e: red-on-base regressions for all four behavior changes; focused tests, the restart-resume acceptance e2e, targeted typechecks, lint and format pass locally; no CI job failed. Merged at the pinned head without waiting for the full CI queue, per Peter's local-proof merge rule.
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Oct 29, 2026
1465250 removed an incidental maintenance await, which exposed a race in the cron failure-alert notification tests; they now wait for the real fallback receipt before asserting acceptance, execution and routing. Separately, openclaw#187090 edited the module-isolation mocks in the Gateway shutdown and spawn-broker tests, which invalidated their grandfathered mock-exports baseline entries and failed the baseline ratchet for every PR; those mocks now carry explicit mock-isolation reasons and the stale baseline entries are pruned. Production is unchanged.
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Oct 29, 2026
The subagent registry supersession test still asserted a nested Gateway root operation that openclaw#187090 deliberately removed (red on main as `0 > 0`). Remove only the obsolete root-counter assertions; keep the overlapping-successor setup and the lifecycle-overwrite assertions. Test-only (+1/-7), no runtime change. Local: subagent-registry.test.ts 77/77 on the exact head. The only failed check was a superseded PR-body format run; its rerun passed.
This was referenced Nov 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
Fixes shutdowns that remain blocked in native wrapper cleanup after the bounded Gateway close has finished, and maintenance handoffs that can expire before the native service stop.
User Impact
Process-owned shutdown respects its existing cleanup deadline and identifies retained sidecar owners. Embedded hosts still join cleanup fully. Subagent termination finishes its internal cleanup after admission closes, and the deployment controller commits shutdown before stopping the service.
Why This Change Was Made
The wrapper now bounds read-only-worker and Linux admission/broker cleanup with the process owner's existing deadline, while the underlying ordered cleanup continues. Fatal core close errors survive an additional cleanup timeout. Existing shutdown tracing supplies sidecar names; no new shutdown subsystem, configuration, dependencies, or persisted shapes are introduced.
The controller uses the existing
commit: truehandoff after its live custody checks, including READY suspensions, and stops polling the retired reversible lease. The public armed-only RPC contract remains supported. Native watchdog budgets are unchanged: the 90-second supervisor case reserves five seconds and adds a two-second watchdog grace, targeting 87 seconds after accepted signal handling. Worker startup latency remains an unproven source of drift; this change does not promise native handle extinction.Evidence
test/gateway-restart-resume.e2e.test.ts: PASS, 63.07s test time. Busy SIGTERM shutdown 475ms; committed maintenance shutdown 583ms. Proves graceful resume, FIFO delivery, and intentionally lossy SIGKILL handling through isolated Gateway processes and a synthetic provider.283532b6071c8c424eeb9abd5bbd6789283a0933: final P0–P2 assessment clean after fixing fatal-error masking. The configured local ClawSweeper checkout was unavailable because it contained unrelated edits; using the documented autoreview fallback.No live Gateway, deployment, release, or real user state was touched. CI timing is pending.