Repository navigation
fix: avoid false update cleanup failures when the host is busy - #150392
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 16, 2026, 8:06 PM ET / September 17, 2026, 00:06 UTC. ClawSweeper reviewWhat this changesThe PR lets queued process-exit and pipe events settle before reporting cleanup timeout, with a real-process regression and updated documentation. Merge readiness✅ Ready for maintainer review This remains a useful, focused fix: current main retains the timeout race, and the related PRs do not replace this work. No blocking correctness defect was found. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s process supervisor manages child commands used by tools and managed update repair. Its relay combines native process termination and output completion into the cleanup result consumed by callers. flowchart TD
A[Command or update repair] --> B[Process supervisor]
B --> C[Relay and process-group anchor]
C --> D[Exit and pipe events]
D --> E[Cleanup owner]
F[Cleanup deadline] --> E
E --> G[Confirmed completion or cleanup error]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +12, Tests +203, Docs +2. Total +217 across 3 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep cleanup decisions in the existing relay owner, allowing queued completion facts to settle while preserving native extinction checks and bounded failure. Do we have a high-confidence way to reproduce the issue? Yes, source establishes a concrete path: block the host after closing acknowledgment while native retirement finishes, then deliver queued exit and pipe events after the deadline. The supplied regression targets that path; this review did not execute it or establish the original hosted stall’s exact cause. Is this the best way to solve the issue? Yes. The patch repairs event-delivery ordering within the existing owner without extending the configured deadline or accepting root exit alone as cleanup proof. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 4428de2785a2. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
Merge current main while retaining #150392 control-EOF joining and deferred expiry. Route extinction wait failures through the retained finalization outcome, and revalidate authority after both observational joins before probing the process group. The PR adds no dependency or protocol changes.
…claw#150392) Fix managed update repair reporting failed process cleanup after its child processes have already stopped while the host event loop is busy. The deadline introduced by openclaw#149005 could reject before Node delivered queued native exit and pipe events, producing the update-managed-service handoff lifecycle failure. The existing relay cleanup owner now lets one I/O poll deliver those facts before final timeout rejection and starts its existing extinction join at control EOF. The five-second budget is unchanged, and repeated cancellation cannot renew it. Missing authority, live descendants, and unfinished output still fail. The regression reproduces the original pending-completion vector on the unfixed owner. The candidate native-retirement case and original repair case each passed 20 executions; integrated relay-owner/caller/readiness/child lifecycle proof passed 92 cases. Changed gates and the scoped P0/P1 review passed. Published-driver markers have boundary coverage; this does not claim an executed published-package upgrade. Installed updater code and existing backup/rollback paths retain their behavior. Related: openclaw#150244, openclaw#149005
Merge current main while retaining #150392 control-EOF joining and deferred expiry. Route extinction wait failures through the retained finalization outcome, and revalidate authority after both observational joins before probing the process group. The PR adds no dependency or protocol changes.
Merge current main while retaining #150392 control-EOF joining and deferred expiry. Route extinction wait failures through the retained finalization outcome, and revalidate authority after both observational joins before probing the process group. The PR adds no dependency or protocol changes.
Merge current main while retaining #150392 control-EOF joining and deferred expiry. Route extinction wait failures through the retained finalization outcome, and revalidate authority after both observational joins before probing the process group. The PR adds no dependency or protocol changes.
Keep child cleanup and eager supervised-process failures visible to callers without letting unobserved rejections crash the Gateway. Publish the retained cleanup promise at the sole spawnServiceChildRelay creation site, join authority finalization and admitted tree signaling, and preserve retained-handle escalation, forced-exit diagnostics, output drainage, and cleanup deadlines. Uncertain extinction remains a failure. Include redacted error stacks in Gateway stability bundles, bounded to 8,000 UTF-16 code units; older bundles without stacks remain readable. No configuration, CLI option, dependency, schema version, or installed update-driver behavior changes. The runtime repair takes effect when the candidate Gateway starts. Related: #144911, #144941. Preserve integration with #150306, #150392, and #150564. The earlier MCP field-crash path is separately contained by #144941; this change closes remaining unobserved-promise paths. Thanks to @itanyplus, @waynegault, @chachi-max, and @kip-claw for the reports and field evidence. Validation: exact-head CI run 35208176360 is green. Recorded focused proof: 395 tests passed and 6 skipped, followed by 64 passing spawn-broker tests; check:changed passed. Codex review is scoped-clean through P1 on a patch-identical revision, and ClawSweeper reports no findings on the landed head. Prior macOS Gateway probes predate final broker integration and do not claim a Linux/systemd field-crash reproduction.
…150427) Keep child cleanup and eager supervised-process failures visible to callers without letting unobserved rejections crash the Gateway. Publish the retained cleanup promise at the sole spawnServiceChildRelay creation site, join authority finalization and admitted tree signaling, and preserve retained-handle escalation, forced-exit diagnostics, output drainage, and cleanup deadlines. Uncertain extinction remains a failure. Include redacted error stacks in Gateway stability bundles, bounded to 8,000 UTF-16 code units; older bundles without stacks remain readable. No configuration, CLI option, dependency, schema version, or installed update-driver behavior changes. The runtime repair takes effect when the candidate Gateway starts. Related: openclaw#144911, openclaw#144941. Preserve integration with openclaw#150306, openclaw#150392, and openclaw#150564. The earlier MCP field-crash path is separately contained by openclaw#144941; this change closes remaining unobserved-promise paths. Thanks to @itanyplus, @waynegault, @chachi-max, and @kip-claw for the reports and field evidence. Validation: exact-head CI run 35208176360 is green. Recorded focused proof: 395 tests passed and 6 skipped, followed by 64 passing spawn-broker tests; check:changed passed. Codex review is scoped-clean through P1 on a patch-identical revision, and ClawSweeper reports no findings on the landed head. Prior macOS Gateway probes predate final broker integration and do not claim a Linux/systemd field-crash reproduction.
Related: #150244, #149005
What Problem This Solves
Fixes managed update repair reporting failed process cleanup after its child processes have already stopped while the host event loop is busy.
User Impact
Repairs can finish when native process-group and output completion are confirmed. Missing authority, live descendants, and unfinished output retain their existing failures.
Why This Change Was Made
The deadline introduced in #149005 could reject cleanup before Node delivered queued native exit and pipe events. The relay owner now lets one I/O poll deliver those facts before final timeout rejection and starts its existing extinction join at control EOF. The five-second budget is unchanged, and repeated cancellation cannot renew it.
This changes the loaded runtime's cleanup owner. It adds no protocol, configuration, schema, or dependency changes; installed updater code and the existing backup/rollback paths retain their behavior.
Evidence
faad1d457de(fix: wait for owned stdio cleanup without premature timeout #149005), the directsetTimeout(expireCleanup, ...)call at line 316. A real-process probe passes with its parent host, fails on main, and passes with this fix. The relevant host/relay/anchor sources are unchanged between the failing branch'seb8bca1326cbase and tested main387da5edaa9.--mode branch --base origin/main --max-priority P1) is scoped-clean, with no accepted/actionable P0/P1 findings.The other baseline failures were the native-control interval case (attempts 1 and 10), a config.set request timeout (attempt 3), and a launchd command-order assertion (attempt 5). The config-reread warning in the original hosted log belongs to a passing neighboring config test.
An initial filtered proof timed out while parallel proof commands rebuilt shared
dist; the exact stall was not captured. An observed cold run then passed every gate in 27.5 seconds, and further runtime proof uses one build owner at a time. The new observer also exposed Darwin's transientEPERMfor an unreaped group; it now keeps that state unconfirmed and still requiresESRCHbefore the unchanged deadline.A later main landing (#147903) split this factory into
{ adapter, ready }. The task branch was refreshed to307255794c4, and the new regression consumes that contract. The unfixed owner reproduced the same hosted pending vector on this refreshed base before the patch was reapplied. Local proof ran on macOS with Node 26.8.2; hosted Linux CI supplies the platform check.Production: +14/-2 lines (net +12). Tests: +203 lines. Docs: +2 lines. No baseline, timeout, or dependency changes.