Repository navigation
Conversation
…d of abandoning it Under CPU load taskkill /t took 4.6-18 s on windows-2022; the 2 s cap killed it, fell back to the root, and left the grandchild alive in 8/8 runs. Raise the cap to 15 s, and keep the preflight fixture alive so it can't pass by exiting. Co-Authored-By: Claude <noreply@anthropic.com>
nwparker
force-pushed
the
nwparker/fix-win-taskkill-tree-cap
branch
from
October 14, 2026 05:39
06676c9 to
7cecbaf
Compare
Contributor
Author
|
Closing: #28577 already landed the same mitigation (a separate Windows taskkill cap, now 5 s; the batch-shim test at 30 s with a longer-lived child). Keeping the measurements here for whoever revisits it. These are real GitHub runners with 2× CPU-core burners, running
Bare The more durable fix, from the review of this draft:
|
Merged
7 of 8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
When Orca stops a command on Windows, it asks Windows'
taskkilltool to end the command and everything it started. On a busy machinetaskkillcan take several seconds. Orca only gave it 2 seconds, then gave up, killed just the top process, and left its children running. This letstaskkillfinish.Draft. Rated MEDIUM by review, so it is not being merged automatically. See "Open design question" below.
What Changed
src/packages/process-host/src/process-tree-termination.ts: the Windowstaskkill /pid X /t /fcall gets its own 15 s bound (WINDOWS_TASKKILL_TIMEOUT_MS), up from the shared 2 sSUBPROCESS_TIMEOUT_MS. POSIX probing keeps 2 s.src/main/ipc/preflight-runnable-local-cli.test.ts, the "hung batch launcher" test:Why
Symptom:
package (windows)failed 8 times in about 1,000pr.ymlruns (about 20 h) on "Windows preflight batch shims › recovers after a hung batch launcher and terminates its Node child". Every failure was a 15 s timeout; passing runs take 5.3 s. This was the single most frequent Windows CI flake.Root cause, measured on real GitHub runners (diagnostic workflow dispatch,
runProcess({ terminationBarrier: true })on a.CMDthat starts a hanging node child, runner loaded with 2× CPU-core burners):taskkillalone took 4.6–7.7 s under that load on windows-2022, against about 50 ms idle.With the 2 s cap, the sequence is: taskkill is killed before finishing, the root is killed by handle, and the barrier reports "unverified". The barrier then waits its 10 s unverified grace and settles anyway, while the grandchild is still running. So on a loaded Windows machine every barrier caller pays an extra ~12 s, and the descendants it was meant to kill survive. The CI test caught exactly that: the 5 s probe plus the ~12.5 s unverified path is longer than its 15 s cap.
Open design question (why this is a draft)
The adversarial review rated this MEDIUM:
runProcessSyncis unaffected.Decision needed: take this bound now as a mitigation, or do the decoupled design.
Linked Issue
N/A (maintainer PR; CI reliability with a product defect behind it).
Visual Proof
N/A: process termination behavior, no UI.
Testing
vitest run src/packages/process-host/src/passes locally (124 tests). The new 7 s taskkill test fails with the old 2 s cap.AI Disclosure
Review
Agent skill upstream boundary
Notes
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)