Skip to content

fix(core): keep a zombie with live threads in the verified group stop - #323

Merged
ElbertePlinio merged 4 commits into
mainfrom
fix/320-zombie-group-stop
Oct 9, 2026
Merged

ElbertePlinio merged 4 commits into
mainfrom
fix/320-zombie-group-stop

Conversation

@ElbertePlinio

@ElbertePlinio ElbertePlinio commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Closes #320

A verified group stop no longer returns while a zombie leader or member still has live threads. parseProcStat now reads num_threads. The stop path counts a process as present when it is not a zombie, or when it is a zombie with more than one thread. Identity and ownership checks still treat every zombie as dead, so PID-reuse rules do not change. Session teardown (stopXvfb), the desktop session stops, Xvfb startup rollback and the Chrome group stop all call stopProcessGroupVerified directly, so this core change covers them.

Requirement Verified by Scenario Result Evidence
Decide how to treat a Z leader with live threads Code, unit tests A Z with num_threads > 1 counts as present only in the stop path; processIdentityMatches and listProcessGroupMembers still treat it as gone Pass packages/core/test/proc.test.ts
Keep tests that fake a zombie working Full suite Existing fakes leave field 20 as 0, so they remain finished zombies 3082 passed, 6 skipped coverage-320.log
Apply the rule to session teardown and the Chrome group stop Code check All callers use stopProcessGroupVerified without an identity pre-check Covered by the core change diff
Test: a stop does not return while a Z leader has a live thread Unit and real-process tests Fake stat: leader Z with threads escalates to SIGKILL, survival after SIGKILL is reported, a Z member with threads is not "already-dead". Real python3 child with a dead main thread and a live thread: the stop waits until threads ≤ 1 Pass; 6 tests fail without the fix worker report
Repo checks Automated build, lint, typecheck, PICKFORGE_REQUIRE_BROWSER=1 coverage Pass coverage-320.log
PickCheck Automated --base origin/main --fail-on new,worsened,unmatched Pass pickcheck-320.json

Evidence is in ~/Artifacts/pickforge-batch6-2026-10-09/ on the build host.

No device pass: this is an internal process-stop rule with nothing to drive, and the tests cover it.

Follow-ups: #322 (containment probes treat a zombie with live threads as gone), #324 (stop reports a group gone when /proc stat is unreadable), #327 (viewer Chrome stop keeps the old zombie rule).

stopProcessGroupVerified treated a zombie group leader as gone even while
its other threads still ran or exited. Read num_threads from /proc stat and
count a zombie with more than one thread as present in the group-gone and
after-SIGTERM checks. Identity checks keep treating every zombie as dead.

Refs #320
@ElbertePlinio
ElbertePlinio merged commit e0fe786 into main Oct 9, 2026
10 checks passed
@ElbertePlinio
ElbertePlinio deleted the fix/320-zombie-group-stop branch October 9, 2026 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

core: verified group stop accepts a zombie leader whose threads still exit

1 participant