Skip to content

fix(containment): treat zombie cgroup members as gone - #311

Merged
ElbertePlinio merged 2 commits into
mainfrom
fix/310-zombie-cgroup-member
Oct 8, 2026
Merged

ElbertePlinio merged 2 commits into
mainfrom
fix/310-zombie-cgroup-member

Conversation

@ElbertePlinio

@ElbertePlinio ElbertePlinio commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Containment cleanup no longer refuses a session because a member became a zombie or was reaped mid-check. classifyCgroupEntries takes one stat snapshot. State Z, ENOENT or ESRCH count as gone only when a fresh cgroup.procs read no longer lists the PID. A listed member stays undecided and retries until the deadline, then refuses before any freeze. This covers a process whose main thread exited while worker threads still run: it shows Z and stays in cgroup.procs, so it is still refused.

Closes #310

Requirement Verified by Scenario Result Evidence
Zombie member counts as gone Automated tests (containment-cgroup-sim.test.ts) Member turns Z after 0, 1 or 2 environment reads and leaves cgroup.procs; Z then reaped (ENOENT) Cleanup confirms, no signal, cgroup removed CI
Exited member with non-empty environment Automated test Tokenless environment, then stat ENOENT or ESRCH No refusal naming the exited PID CI
Live foreign and recycled members still refuse Automated tests Z, ENOENT, ESRCH, EACCES while still listed; foreign token; recycled PID; mid-exec Refusal, no kill, no freeze CI
Leader-exited process semantics Kernel probe by the author Main thread pthread_exit, worker sleeps Leader Z, worker S, PID still listed, environ ESRCH Sol run log
Deterministic test Simulated /proc and cgroup.procs No timing dependence Pass CI

Checks: lint, typecheck, build, GSK_RENDERER=cairo bun run test:coverage (2,995 passed, 6 skipped), PickCheck clean. Reviews: Astra and Fable at xhigh, one repair round, all findings resolved.

QA pass skipped: the change is an internal classification in cleanup with nothing to drive. The simulated cgroup tests cover the behavior.

@ElbertePlinio
ElbertePlinio merged commit b714d75 into main Oct 8, 2026
10 checks passed
@ElbertePlinio
ElbertePlinio deleted the fix/310-zombie-cgroup-member branch October 8, 2026 21:24
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: containment classifies a zombie cgroup member as foreign

1 participant