Repository navigation
fix(qa): stop live threads after their process leader exits - #147386
Conversation
Use the canonical PID-death check so a zombie Linux leader with surviving threads retains the process-group cleanup obligation. Preserve unknown-status and existing signal behavior. Closes #147385
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
@clawsweeper re-review The test-only correction removes an invalid TypeScript namespace access; the 17 focused group tests and extension test-type lane passed. Production source and real process cleanup proof are unchanged. Please review current head |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed September 13, 2026, 5:02 PM ET / 21:02 UTC. ClawSweeper reviewWhat this changesQA cleanup now uses the shared PID-death check to retain responsibility for Linux worker threads that survive their process leader. Merge readiness✅ Ready for maintainer review The PR remains useful: current main and the latest release retain the weaker liveness check. The corrected mock resolves the reported TypeScript issue without changing production behavior, and no actionable patch defect was found. Priority: P2 Review scores
Verification
How this fits togetherQA Lab starts and stops isolated Gateway and command processes. Its process-group inspection determines whether cleanup must continue before reporting completion. flowchart TD
A[QA child process group] --> B[Linux process snapshot]
B --> C[Filter group members]
C --> D[Shared PID and thread check]
D --> E{Any member still alive?}
E -->|Yes or uncertain| F[Continue group cleanup]
E -->|No| G[Report stopped]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +4, Tests +40. Total +44 across 3 files. View PR surface stats
Review metricsNone. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep Linux process-group cleanup tied to the shared conservative PID-death contract, with RSS availability handled separately. Do we have a high-confidence way to reproduce the issue? Yes. A Linux child whose leader calls pthread_exit while a worker survives exposes the state-only check on current main; the supplied report exercises the actual cleanup entrypoint. This read-only review did not rerun it. Is this the best way to solve the issue? Yes. Reusing the existing thread-aware PID check removes the weaker duplicate rule without expanding the SDK, changing signal targets, or increasing timeouts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against edde862d16b2. 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.
|
…1-prep * commit '912ae8d96e5964dfdcdf419b79613fb941cdf0a8': (350 commits) fix: keep workspace preparation responsive during cleanup (openclaw#147358) docs: alphabetize donors and sponsors and add Red Hat logo (openclaw#147302) fix(plugins): retain update authority through doctor effects (openclaw#144316) refactor(qa): share Multipass mount retry lifecycle (openclaw#147084) fix(memory): emit one JSON result for command failures (openclaw#147366) improve(plugins): speed up cold metadata loading (openclaw#147411) fix(sessions): avoid duplicate work after waited child replies (openclaw#147394) fix(agents): retain outstanding child results in parent context (openclaw#112623) test: preserve native workflow loader selection (openclaw#147403) fix: reduce repeated work while polling session pull requests (openclaw#147373) test(qa): preserve task cancellation across process replacement (openclaw#147382) fix: prevent sidebar refresh storms during session activity (openclaw#147400) refactor: simplify skills CLI formatting (openclaw#147368) fix: prevent Git checkout certificate failures behind egress proxy (openclaw#147410) fix(qa): stop live threads after their process leader exits (openclaw#147386) refactor(release): share agent turn retry lifecycle (openclaw#147076) fix(ui): keep uploaded images aligned with their prompts (openclaw#147389) fix(fs): guard skill reads and bound worker bundle staging (openclaw#147336) fix(ci): restore Linux service ownership fixtures (openclaw#147398) fix(plugins): preserve manifest permissions when building plugins (openclaw#147393) ...
…#147386) * fix(qa): stop live threads after their process leader exits Use the canonical PID-death check so a zombie Linux leader with surviving threads retains the process-group cleanup obligation. Preserve unknown-status and existing signal behavior. Closes openclaw#147385 * test(qa): preserve typed fs namespace in default mock
Closes #147385
What Problem This Solves
Fixes: QA teardown can report a threaded process as stopped after its main thread exits, while another thread in the owned process group is still running.
User Impact
QA cleanup now retains responsibility for surviving worker threads and terminates the actual group before reporting success. Existing signal targets, timeout allowances, and non-Linux behavior are unchanged.
Why This Change Was Made
A Linux zombie leader does not by itself prove that its entire process has exited. Group inspection now uses the existing conservative SDK PID-death check, including its thread-count and unknown-status handling, instead of duplicating a weaker state-only rule.
Production: +10/-6 (net +4); tests: +55/-15. The added parameter connects the group owner to the canonical liveness contract. No SDK surface, new process tracker, or timeout increase is introduced.
Evidence
The corrected test mock additionally passed all 17 process-group tests and the repository extension test-type lane on Linux/Node 24.19.0. Fresh scoped autoreview and independent review found no actionable issue. Production source blobs and the independently verified real-process GREEN proof are unchanged.
pthread_exit. Before the fix, liveness returnedfalseand cleanup returnedconfirmed-stoppedwhile an independent group pidfd still showed the worker alive.true; production cleanup terminates the group with SIGTERM, and the immediate independent pidfd witness confirms completion before fixture fallback cleanup. The named case passes, child close is recorded, and the temporary test overlay is restored.b9a099e0a5fdaa8c14914da1c5c0d2797b223912; those bytes match signed commiteb96738d5c2a0138f595af4fcc73225a0c9329e5.git diff --checkpass. Hosted exact-head CI and native maintainer qualification are pending.The separately observed stateless RSS=0 reporting defect remains outside this PR. This proof does not establish ordinary incidence or a released-version boundary.