Repository navigation
test: count a group of zombies as ended, and kill create once it wrote the manifest - #314
Conversation
…e the manifest - groupEnds waited for init to reap the program's killed orphans: kill(-pgid, 0) finds a zombie. On a loaded host init reaped them after the 2 s deadline, so "destroy ends a child of the program whose main thread exited" and the tests of a background process failed although destroy had ended every process. On Linux groupEnds now reads the threads in /proc and counts a group whose threads are all zombies as ended. - The early-destroy test killed create once the program ran, so it still needed the host to start the program before create gave up. It now kills create once the manifest exists: the host reads an existing manifest also after its creator died. Its envelope wait is 30 s.
|
@codex review |
|
@codex security review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f9f11d1180
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…proc hides processes Codex on #314: a process can fork and end between the /proc listing and its own read, and a /proc that is missing, refuses a read or hides other users cannot show the whole group.
|
@codex review |
|
@codex security review |
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
… only ENOENT pass the sessions read #314 advisor: a /proc of another pid namespace shows no member of the group, so the probe decides there. Only a missing sessions folder means that create has not written yet.
|
@codex review |
|
@codex security review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
Why
"destroy ends a child of the program whose main thread exited while another thread runs" needed 2 retries on main and on #311, on this shared host at load averages of 60 to 80. The #311 advisor also found that the early-destroy test still needed the host to start the program before
creategave up after about 5 s. Follow-up of #311.Cause
groupEndsintest/helpers.tspolledkill(-pgid, 0)for 2 s. That call also finds a zombie. A program's background process is an orphan once its parent shell dies, so init reaps it, not the host. On a loaded host, init reaped it after the 2 s deadline. The test then failed althoughdestroyhad already ended every process of the group.I reproduced this with a child subreaper that reaps only every 10 s (
slow-reaper.pybelow). Main failsgroupEndsin 2 or 3 of the 5 selected tests per run:This branch passes 5 of 5.
Repro wrapper (not committed)
What changes
Only test helpers and one test change.
groupEndsnow reads the threads of each group member in/proc. A group whose threads are all zombies counts as ended. A live thread, such as the running thread ofzombie-leader.pywhose main thread exited, still counts as running. Two scans must agree, because a process can fork and end between the/proclisting and its own read. In some cases/proccannot show the whole group: the listing fails, a read is refused,/prochashidepid=2,4,invisibleorptraceable, or mountinfo is unreadable. Then thekill(-pgid, 0)probe decides alone, as before. The probe also decides alone when a scan finds the group id but shows no member at all, as a/procof another pid namespace does. Off Linux it keepskill(-pgid, 0), because launchd reaps orphans at once. The deadline is now 5 s, which costs nothing when the group ends sooner.createas soon as the manifest exists. The host reads an existing manifest also after its creator died (waitForManifestFromCreate,src/host/hostMain.ts). So the test no longer needs the host to start the program beforecreategives up. Its envelope wait is now 30 s instead of 15 s.cleanupHomehad killed the held host, because it SIGKILLs thehostPidthat the manifest names. No change is needed.Validation
tsc --noEmit,oxlintandoxfmt --checkpass.destroy(the test: keep the lifecycle tests stable on a slow runner and cut fixed waits #311 preload), the early-destroy test passes.groupEndsagainst a livezombie-leader.py. It still reads the group as running after 1.5 s, and it reads the group as ended right after a SIGKILL.Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:xhigh