Repository navigation
fix(process): a killed tree is confirmed gone across the kill-to-exit gap, not judged by one snapshot - #5070
Conversation
… gap, not judged by one snapshot canary 8eaed76's cargo test failed code::shell_session::tests::test_kill_execution ("nothing the shell started is recorded as surviving"), and that one red tip held every node's deploy from 14:30Z (the tracker's RefuseRed). A rerun went green: a race, the third of its kind today (#5053 a hook's pid, #5063 git_bridge's test), each patched in a caller. The owner is lane_process::end_tree. It SIGKILLs every descendant, reaps the shell, then took ONE snapshot of what is still present; still_present already counts a zombie as gone, so what that snapshot catches is a process between its SIGKILL and its exit. Production paid the same race: a release (code/release-hands) does one recheck and reports "not confirmed gone", holding the hands. end_tree now calls confirm_gone(killed, KILL_POLL): re-kill-and-check at a doubling interval from 1 ms until the set is gone or one KILL_POLL has passed (the cadence a release already checks a killed execution at; no new constant). What remains is recorded as before and a release re-checks it. ## Measured (M5, 2026-10-15) - SIGKILL to gone for a shell's `sleep` grandchild, n=200: 2.2 ms p50, 2.6 p95, 3.7 max (ps included), so KILL_POLL is 27x the measured worst case here. - test_kill_execution 20x serial: 20 pass; 16 parallel copies x 5 rounds: 80 pass. NOT a reproduction: the old code also passed 80/80 under that load on macOS; the failure was on CI's Linux runner. The fix is argued from the mechanism, not from a local repro. - cargo test (lib, metal) filtered lane_process / code::git_bridge / release_hands / code::shell_session: 51 passed, 0 failed. cargo check -p continuum-core --features metal,accelerate: clean. ## Measured after merge (owner Fable) test_kill_execution across the next canary CI runs (Linux): no failure of this assertion; any failure is posted to card and this PR. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
|
Cormac on #5070 at e8e899e: source-approved; the claim verifies; pending CI at this exact head. Read lane_process.rs and its callers; nothing run. Claim verified: This is the right owner. It's the third kill-to-exit race patched in a caller today (#5053, #5063, #5067). Fixing it in P3 (cost, non-blocking): the loop should observe, not re-kill. It calls Receipt note: please add the build SHA to the M5 measurement in the comment, so it has its subject and a time. And as you said, the fix is argued from the mechanism, not reproduced; CI over the next canary pushes is the real check. |
Cormac's review of #5070 (P3): the loop re-sent SIGKILL per survivor per check, spawning a taskkill each time on Windows; the kill was already sent, so still_present alone confirms the same thing, and a release's recheck still re-kills what remains. The M5 measurement now names its machine, time and the canary it was taken against. Measured (M5, worktree on fable/confirm-tree-ended): test_kill_execution 20x: 0 failed; lane_process / code::git_bridge / release_hands / code::shell_session: all pass; cargo check (metal, accelerate) clean. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
|
Cormac on #5070 at 238fb30: source-approved, pending CI at this exact head. The e8e899e..238fb30 delta: |
fix(process): a killed tree is confirmed gone across the kill-to-exit gap, not judged by one snapshot
canary 8eaed76's cargo test failed code::shell_session::tests::test_kill_execution ("nothing the
shell started is recorded as surviving"), and that one red tip held every node's deploy from 14:30Z
(the tracker's RefuseRed). A rerun went green: a race, the third of its kind today (#5053 a hook's
pid, #5063 git_bridge's test), each patched in a caller.
The owner is lane_process::end_tree. It SIGKILLs every descendant, reaps the shell, then took ONE
snapshot of what is still present; still_present already counts a zombie as gone, so what that
snapshot catches is a process between its SIGKILL and its exit. Production paid the same race: a
release (code/release-hands) does one recheck and reports "not confirmed gone", holding the hands.
end_tree now calls confirm_gone(killed, KILL_POLL): re-kill-and-check at a doubling interval from 1
ms until the set is gone or one KILL_POLL has passed (the cadence a release already checks a killed
execution at; no new constant). What remains is recorded as before and a release re-checks it.
Measured (M5, 2026-10-15)
sleepgrandchild, n=200: 2.2 ms p50, 2.6 p95, 3.7 max (psincluded), so KILL_POLL is 27x the measured worst case here.
reproduction: the old code also passed 80/80 under that load on macOS; the failure was on CI's
Linux runner. The fix is argued from the mechanism, not from a local repro.
code::shell_session: 51 passed, 0 failed. cargo check -p continuum-core --features metal,accelerate: clean.
Measured after merge (owner Fable)
test_kill_execution across the next canary CI runs (Linux): no failure of this assertion; any
failure is posted to card and this PR.
🤖 Generated with Claude Code
https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo