fix(core): a Windows stop can refuse because the owner's lease lapses during a slow first process listing
Problem
On a loaded Windows host, archon workflow cancel or abandon can refuse on its first attempt. The Windows stop (#3466, PR #3487) lists the owner's process tree with Get-CimInstance Win32_Process before killing anything, then checks that the owner's termination lease is still open. That check exists so Archon never kills a PID Windows has already reused. Under CPU stress, the first, cold listing takes 4 to 8 s. The owner's termination lease is 8 s (TERMINATION_LEASE_MS in packages/core/src/services/run-live-owner.ts), so it can expire during that listing, and the stop then refuses as designed. It showed up twice in stressed CI loops on PR #3515, both times on the cold first iteration (details on #2924).
Why it matters
It fails safe: the run is left unchanged and nothing is recorded as cancelled while a process is still alive. But the operator sees "couldn't stop" and has to retry, on exactly the loaded machines where stopping a run matters most.
Why now
This is the only product-side residual from the Windows stop work shipped in v0.11.0.
Desired outcome
A stop against a live owner on a loaded Windows host succeeds on its first attempt, or explains why it can't. The PID-reuse protection stays.
Invariants
- No timer or age decides that a process is dead.
- A root PID that may have been reused is never killed.
- POSIX behaviour is unchanged.
Acceptance
- In the stressed Windows loop from PR #3515, a stop no longer refuses because the lease lapsed during the first listing.
- CI passes on
windows-latest.
Source: coleam00/Archon