Repository navigation
fix(core): never treat an unreadable or zombie-with-threads group as gone - #331
Merged
Merged
Conversation
A /proc/<pid>/stat read that fails with EPERM or EACCES no longer counts as a gone process in the verified group stop. Only ENOENT and ESRCH mean gone. An unreadable leader refuses the stop, or stops escalation after SIGTERM. Unreadable entries with a group that still answers a signal-0 probe keep the group unverified. The new unverified outcome is not a success, so callers keep the state the group uses. Refs #324
…reads The viewer stop now counts group members with the verified group stop rule through the new readProcessGroupPresence core export. A zombie with live threads stays present, and unreadable /proc entries in a group that still exists keep the launch directory and profile in place. Refs #327
2 tasks done
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.
The verified group stop no longer treats an unreadable
/proc/<pid>/statas proof that a process is gone. Only ENOENT and ESRCH mean gone. EPERM, EACCES and unparsable stat lines now give a newunverifiedoutcome, so teardown keeps the state the group may still use. The viewer Chrome stop now uses the same present-member rule as the group stop, so a zombie with live threads, or an unreadable member of a group that still exists, keeps the launch directory and profile.Closes #324
Closes #327
unverifiedwith no signal. After SIGTERM:unverifiedwith no SIGKILL. After SIGKILL:unverifiedinstead ofterminated. A group whose probe gives ESRCH is stillalready-dead.packages/core/test/proc.test.ts. The new tests failed on main.browser/src/session.ts,cli/src/viewer/bridge-daemon.ts,desktop-linux/src/apps.ts,display.tsandsession.tsall accept onlyterminatedoralready-deadas successunverifiedoutcome. Every caller already keeps its state on it, so no caller changed.reusedorunverified.remainingViewerProcessesuses the new corereadProcessGroupPresencepackages/desktop-linux/test/viewer-state.test.tspthread_exitwhile another thread runs, as leader and as member, for both prune and removekill(pid, 0)check, and now guards against regressions.viewer-state.test.ts"keeps the launch while a zombie leader/member still has live threads"PICKFORGE_REQUIRE_BROWSER=1 vitest run --coverageQA pass skipped: this changes internal process-teardown logic with no UI or CLI output to drive. Real-kernel zombie tests exercise the viewer path.
API note:
@pickforge/lab-coregains thereadProcessGroupPresenceexport and anunverifiedmember ofStopProcessGroupOutcome. Both are additive. Core is a workspace package and is not published.Reviews: Astra (xhigh) found that the after-SIGTERM path reread the leader after its identity check, so PID reuse or EPERM at that moment could still escalate to SIGKILL. Fable (xhigh) flagged the same double read. e706624 restores the order main used, with members scanned first and the leader read last, and adds a regression test. Astra and a fresh Fable reviewer both confirmed the fix. The viewer stop still cannot signal a zombie leader with live threads itself; that is tracked in #329.