Repository navigation
fix(qa): recognize process groups reaped during cleanup - #132230
Conversation
Recheck kernel existence when a Linux proc snapshot cannot decide liveness, and accept vanished proc handles alongside vanished paths. This prevents an already-stopped group from appearing alive again during zombie reaping. Use the canonical idempotent group signal helper in lifecycle fixture cleanup, preserving permission failures and confirmed-termination checks. Failed replacement ownership and retry-stop behavior remain unchanged. Verified with a deterministic real Linux reaper before/after probe, failing pre-fix race regressions, 129 owner/sibling tests, the full 220-file QA shard (3046 tests), three lifetime-file reruns, and complete-delta P0 autoreview.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 28, 2026, 8:33 PM ET / August 29, 2026, 00:33 UTC. ClawSweeper reviewWhat this changesThis PR makes QA Lab re-check POSIX process-group existence after an inconclusive Linux Regression provenancePossible regression — probable (reviewed change; reproduction). No predecessor PR is attributed. Merge readinessKeep open for maintainer review: the PR repairs a real current-main QA liveness race at the shared owner boundary, while the exact-head changed-extension check is still running and the PR carries the protected Priority: P2 Review scores
Verification
How this fits togetherQA Lab launches Gateway subprocess groups for isolated scenarios and verifies their termination before settling cleanup. The shared liveness result feeds process-tree cleanup and determines when scenario resources can be considered stopped. flowchart LR
A[QA scenario cleanup] --> B[Process group liveness check]
B --> C[Kernel signal-zero probe]
C --> D[Linux proc snapshot]
D --> E[Fresh kernel probe]
E --> F[Stopped or alive result]
F --> G[Process and resource cleanup]
Decision needed
Why: The implementation is narrowly scoped and source-supported, but the protected maintainer label requires an explicit maintainer decision rather than automated cleanup. Before merge
Agent review detailsSecurityNone. PR surfaceSource +3, Tests +68. Total +71 across 4 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the shared-owner repair once exact-head QA CI is green, retaining the new race coverage and the existing conservative handling of permission failures. Do we have a high-confidence way to reproduce the issue? Yes, source inspection shows current main returns alive for an inconclusive Linux snapshot after a successful probe, and the PR supplies a deterministic Linux reaping scenario for the intervening-exit race. Is this the best way to solve the issue? Yes. The patch repairs the shared liveness owner used by Gateway child cleanup instead of masking the race in individual consumers or extending timeouts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against ad6739064efa. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Exact head I inspected the complete four-file delta and the current main owner/callers. The committed bytes match the real Linux reaping red/green proof, 129 owner/sibling tests, complete 220-file / 3046-test QA config, three complete lifetime-file repeats, full changed gate, and fresh isolated P0 autoreview documented above. Executable production LOC remains net-neutral; permission errors, actual descendants, failed replacement tracking and all-dead assertions remain protected. Original CI kernel scheduling remains an inference, explicitly separated from the deterministic real-kernel reproduction. The latest ClawSweeper entry is an active review placeholder with no posted rank-up findings yet. Current main rules require the passing aggregate check and do not require an additional approval; there are no outstanding review requests or changes-requested reviews. No approval or CI bypass is being used. This is the focused main QA unblock; it does not establish full release verification. |
|
Merged via squash.
|
…#132230) Recheck kernel existence when a Linux proc snapshot cannot decide liveness, and accept vanished proc handles alongside vanished paths. This prevents an already-stopped group from appearing alive again during zombie reaping. Use the canonical idempotent group signal helper in lifecycle fixture cleanup, preserving permission failures and confirmed-termination checks. Failed replacement ownership and retry-stop behavior remain unchanged. Verified with a deterministic real Linux reaper before/after probe, failing pre-fix race regressions, 129 owner/sibling tests, the full 220-file QA shard (3046 tests), three lifetime-file reruns, and complete-delta P0 autoreview.
Consolidate image traversal, request observation ownership, bus waiters, Slack response classification, Node selection and WebSocket decoding. Retire the generic Windows executable export after its Node caller moved; keep trusted taskkill/PowerShell paths and all environment validation. Remove duplicate planner validation and unsupported private lifecycle guards. Keep external evidence validation, security authority, resource limits and ordinary write-capable shutdown settlement. Also preserve WhatsApp audio preflight when enabling message actions and avoid recording a POSIX pipe-drain failure during the normal TERM grace. Best-effort tradeoffs accepted: - Bus cloning trusts its private typed event union. 0ebeee8 added the unsupported-kind throw only for lint; fabricated internal kinds now fail naturally, and a new typed variant must update this owner at compile time. - Overlapping private QA driver transitions are unsupported; callers await them. #113855 introduced synthetic interleavings, not a human incident. - Canonical smoke selection is trusted instead of revalidated; #114055 was an ownership cutover. A future selector defect belongs at that owner. - Wire image inputs are parsed JSON trees. #71311 introduced no human cyclic-input incident; unsupported internal cyclic objects are best effort. - Fabricated cyclic/BigInt tool outputs now fail clearly instead of becoming empty evidence. 195e721 added stabilization, not a human incident. - Reinstalling the private AIMock mount is unsupported. bdc9c60 added speculative guards; the actual owner installs it once before start. - Obsolete repeated observer disposal after port reuse can remove the newer QA lookup. 6386dc4 was an affinity repair, not a disposal incident; normal unique-port ownership and stop ordering prevent that lifecycle. - Local non-federated Matrix joins fail immediately on setup errors; #64489 added initial coverage, not a reported transient-join incident. Rerun the QA command after an unusual setup fault. - Artifact publication is trusted after its awaited atomic writer. #92606 added suite execution, not a missing-write incident; deletion afterward is reported by normal readers. - Native browser JSON needs no branded rawJSON surrogate workaround. #140882 added that generality without a human incident; a future branded producer must own its serialization contract. - Insertion-only pending caches clear directly on settlement. #113926 and #128379 supplied no human successor-eviction incident; no replacement can precede these finalizers. Real close-time successor checks stay. - Re-registering the identical private borrowed-relay handle is unsupported. #128379/#133706 introduced no such incident; the owner creates fresh handles and current authority and distinct-successor comparisons remain. - Inconclusive Linux process snapshots conservatively stay alive until the next check. #132230/#131643 used controlled fault injection, not a human actual-use incident. Final unconfirmed settlement retains state for retry.
…0889) Consolidate image traversal, request observation ownership, bus waiters, Slack response classification, Node selection and WebSocket decoding. Retire the generic Windows executable export after its Node caller moved; keep trusted taskkill/PowerShell paths and all environment validation. Remove duplicate planner validation and unsupported private lifecycle guards. Keep external evidence validation, security authority, resource limits and ordinary write-capable shutdown settlement. Also preserve WhatsApp audio preflight when enabling message actions and avoid recording a POSIX pipe-drain failure during the normal TERM grace. Best-effort tradeoffs accepted: - Bus cloning trusts its private typed event union. f993a27 added the unsupported-kind throw only for lint; fabricated internal kinds now fail naturally, and a new typed variant must update this owner at compile time. - Overlapping private QA driver transitions are unsupported; callers await them. openclaw#113855 introduced synthetic interleavings, not a human incident. - Canonical smoke selection is trusted instead of revalidated; openclaw#114055 was an ownership cutover. A future selector defect belongs at that owner. - Wire image inputs are parsed JSON trees. openclaw#71311 introduced no human cyclic-input incident; unsupported internal cyclic objects are best effort. - Fabricated cyclic/BigInt tool outputs now fail clearly instead of becoming empty evidence. 5929e9a added stabilization, not a human incident. - Reinstalling the private AIMock mount is unsupported. e98e098 added speculative guards; the actual owner installs it once before start. - Obsolete repeated observer disposal after port reuse can remove the newer QA lookup. ace0e05 was an affinity repair, not a disposal incident; normal unique-port ownership and stop ordering prevent that lifecycle. - Local non-federated Matrix joins fail immediately on setup errors; openclaw#64489 added initial coverage, not a reported transient-join incident. Rerun the QA command after an unusual setup fault. - Artifact publication is trusted after its awaited atomic writer. openclaw#92606 added suite execution, not a missing-write incident; deletion afterward is reported by normal readers. - Native browser JSON needs no branded rawJSON surrogate workaround. openclaw#140882 added that generality without a human incident; a future branded producer must own its serialization contract. - Insertion-only pending caches clear directly on settlement. openclaw#113926 and openclaw#128379 supplied no human successor-eviction incident; no replacement can precede these finalizers. Real close-time successor checks stay. - Re-registering the identical private borrowed-relay handle is unsupported. openclaw#128379/openclaw#133706 introduced no such incident; the owner creates fresh handles and current authority and distinct-successor comparisons remain. - Inconclusive Linux process snapshots conservatively stay alive until the next check. openclaw#132230/openclaw#131643 used controlled fault injection, not a human actual-use incident. Final unconfirmed settlement retains state for retry.
kill(-pgid, 0) still succeeds while an unreaped zombie remains in the group. When that zombie is reaped before the /proc scan, the snapshot is empty and the owner returned the stale successful probe as "alive". Hosted Extension Tests shard-2 hit this in 3 of the last 8 hourly main runs via gateway-child-bootstrap assertStopped. Restore the fresh kernel existence probe for inconclusive snapshots (added in #132230, removed in #170889) and its regression test. A group that still exists stays alive; only a fresh ESRCH releases it.
…171692) kill(-pgid, 0) still succeeds while an unreaped zombie remains in the group. When that zombie is reaped before the /proc scan, the snapshot is empty and the owner returned the stale successful probe as "alive". Hosted Extension Tests shard-2 hit this in 3 of the last 8 hourly main runs via gateway-child-bootstrap assertStopped. Restore the fresh kernel existence probe for inconclusive snapshots (added in openclaw#132230, removed in openclaw#170889) and its regression test. A group that still exists stays alive; only a fresh ESRCH releases it.
Related: #131643, #131740. Unblocks the QA lifecycle checks on #129276 and #132090.
What Problem This Solves
Resolves a problem where Linux QA cleanup can report an already-stopped process group as alive, or throw
ESRCHafter checking it. This interrupted the extension QA gate before the doctor and Gateway repairs could land.Why This Change Was Made
The shared POSIX group owner previously reused a successful
kill(0)observation after/procinspection. Reaping the last zombie between those observations leaves an empty snapshot, which was converted back toalive=true. The owner now makes a fresh kernel existence probe when that snapshot is inconclusive, and treats/procESRCHas an exited member alongsideENOENT.The two real-process fixtures use the existing idempotent group-signal helper and retain their tracking until termination is confirmed. Live descendants, permission errors, failed replacement ownership, and retry-stop semantics remain protected. No retries, larger timeouts, assertion weakening, new settings, dependencies, or lifecycle policy changes.
User Impact
QA shutdown and CLI/scenario settlement recognize groups that actually disappeared during reaping. This is an internal QA reliability repair, with no operator Gateway or user configuration change.
Production: +8/-5, net +3; those three net lines explain the kernel race, while executable LOC is net-neutral. Tests: +77/-9. The stale liveness default and raw fixture signal calls are replaced at their existing owners.
Evidence
Tested source is commit
c48f6ae017240b7b0ac550428292038d618195ab, based onb4833bf0eff0f99bda1adab7d3c1b821a23a75e0. All four committed file hashes match the reviewed and Linux-tested bytes.setsidchild is held as a zombie withwaitid(WNOWAIT), then reaped through a FIFO handshake between the first kernel probe and/procinspection. Before:result=true, empty members, finalESRCH. After:result=false, finalESRCH; supervisor joined exit 0 and fixture files removed.Complete CI-parity shard command:
CI=1 OPENCLAW_VITEST_MAX_WORKERS=2 OPENCLAW_TESTBOX=1 \ OPENCLAW_TESTBOX_REMOTE_RUN=1 \ OPENCLAW_NODE_TEST_CONFIGS_JSON='["test/vitest/vitest.extension-qa.config.ts"]' \ OPENCLAW_VITEST_SHARD_NAME=changed-extensions-config-38 \ node --import tsx scripts/ci-run-node-test-shard.mtsThe original CI logs did not capture kernel state: their exact scheduling is inferred from the matching deterministic real-kernel reproduction. The unchanged full baseline passed, so it is not presented as a natural full-shard red reproduction. Original failures: doctor cleanup ESRCH and Gateway all-dead assertion.
Direct source audit covered the group/stat owner, Gateway process/lifetime/startup cleanup, CLI settlement and sibling lifecycle tests. The behavior follows the Linux process-group signal contract, exited
/prochandle contract, and Node 24.19.0process.killimplementation. Consumer-only retries or weakening failed-replacement retention would leave the shared owner defect intact.Provenance: the stale default is from #120010, authored by @vincentkoc and merged by @RomneyDa on August 8; the new lifetime coverage in #131740 made it visible. This repair preserves that coverage and its ownership invariant. AI-assisted implementation and review.