fix(ci): stop kill-grace from bounding Windows helper spawns - #1823
fix(ci): stop kill-grace from bounding Windows helper spawns#1823tthayer wants to merge 3 commits into
Conversation
The Windows shard failed Step 0i (parallel suite scheduler contract) with "cleanup failed: hang_after_summary: leader exited leaving live descendants" while its sibling shard passed the same contract. Nothing in the wave was actually leaking a process. run-test-wave.py passed --kill-grace as the subprocess timeout for the two external Windows helpers: taskkill.exe /T /F and the powershell.exe Get-CimInstance descendant probe. Those are different quantities. kill_grace budgets how long a doomed process may take to die; the helpers also have to pay process spawn plus, for PowerShell, CIM startup. The contract fixtures run with --kill-grace 1, and one second is not reliably enough to launch either helper on a loaded runner. The two timeouts then compounded. A timed-out taskkill is reported as "could not prove process-tree cleanup", which raises out of the wave loop; the finally-block cleanup re-enters with the leader already dead, so it falls to the descendant probe, which times out on the same one-second budget and takes its "cannot prove absence -> assume the worst" branch. Phantom descendants, red wave. Give helper invocations their own floor, max(kill_grace, 30). kill_grace still governs every actual death wait, so nothing fails open: the timeout-race contract still refuses with rc=2 over a genuinely surviving descendant, now because PowerShell answered rather than because it timed out. The production path already passed --kill-grace 15 and is unchanged in behaviour. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Tony Thayer-Osborne <tony.thayerosborne@conductorone.com>
The parallel-suite scheduler contract gave the scheduler a flat 8-second budget to finish refusing. On Windows that refusal costs external helper spawns (taskkill.exe, and powershell.exe for the descendant probe), which the scheduler now budgets with its own floor rather than --kill-grace. Read that floor out of the scheduler instead of restating it: hard-coding a number here silently turns a slow runner into a harness failure the moment the two drift apart. The refusal path can spend the floor twice -- once proving descendants, once in the cleanup re-entry -- so allow both plus interpreter startup. POSIX is unchanged: the refusal is signal-driven and still lands inside the original 8 seconds. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Tony Thayer-Osborne <tony.thayerosborne@conductorone.com>
|
Thanks for opening this — it has been seen, and it is queued. This note is automated, but it is not a brush-off: it exists so you know where your PR stands instead of having to guess from silence. Current review status: working through a backlog. What that means for this PR, concretely:
Things that will genuinely speed it up whenever review does happen:
If this fixes a bug, a reproduction we can run is worth more than a description of the symptom. Thanks for contributing, and sorry in advance for the wait. |
|
Thank you for splitting the Windows process-control fix into a focused PR and for documenting the difference between helper startup time and process death grace. The contribution queue is quite full, so the full review may take a little time. We have the PR routed and will come back with grounded feedback as soon as possible. |
|
Approved, and this one is worth more than its 39 lines: it closes #1963, which was filed from this queue after the same failure reddened an unrelated pull request. Your causal chain is exactly right, and it is the part most people would not have found. A timed-out And the underlying confusion is stated in one sentence: I verified the safety claim rather than taking it. On So the timeout-race contract still refuses with rc=2 over a genuinely surviving descendant — now, as you say, because PowerShell answered rather than because it timed out. Nothing fails open, and the production path at Having the contract read the floor out of the scheduler is the right call. Shipping both halves together is correct given the import. StatusClearance is This is One clarification so the scope stays honest: this addresses |
Split out of #1426 at maintainer request — process-control change, reviewed on its own.
Problem
The Windows shard failed Step 0i (parallel suite scheduler contract) with
cleanup failed: hang_after_summary: leader exited leaving live descendantswhile its sibling shard passed. Nothing was actually leaking a process.run-test-wave.pypassed--kill-graceas the subprocess timeout for two external Windows helpers:taskkill.exe /T /Fand thepowershell.exeGet-CimInstancedescendant probe. Those are different quantities.kill_gracebudgets how long a doomed process may take to die; the helpers also pay process spawn plus, for PowerShell, CIM startup. Contract fixtures run with--kill-grace 1, which is not reliably enough to launch either helper on a loaded runner.The two timeouts compounded: a timed-out
taskkillis reported as "could not prove process-tree cleanup", which raises out of the wave loop; the finally-block cleanup re-enters with the leader already dead, falls to the descendant probe, which times out on the same one-second budget and takes its "cannot prove absence -> assume the worst" branch. Phantom descendants, red wave.Change
scripts/run-test-wave.py: helper invocations get their own floor,max(kill_grace, WINDOWS_HELPER_TIMEOUT_SECONDS=30).kill_gracestill governs every actual death wait, so nothing fails open — the timeout-race contract still refuses with rc=2 over a genuinely surviving descendant, now because PowerShell answered rather than because it timed out. The production path already passed--kill-grace 15and is unchanged in behaviour.tests/test_parallel_harness_contract.sh: the flat 8s budget for the scheduler's refusal now reads the floor out of the scheduler on Windows rather than restating it — hard-coding it turns a slow runner into a harness failure the moment the two drift. The refusal path can spend the floor twice (proving descendants, then cleanup re-entry), so it allows both plus interpreter startup. POSIX is unchanged at 8s: the refusal there is signal-driven.The two halves ship together because the contract imports
WINDOWS_HELPER_TIMEOUT_SECONDSfrom the scheduler.Validation
tests/test_parallel_harness_contract.shpasses locally on darwin arm64. The Windows behaviour it guards is exercised by the Windows shard in CI.🤖 Generated with Claude Code