Repository navigation
Kill the whole process tree on overruns and abort force-stops - #15
Merged
Merged
Conversation
Invoke-PkProcessWithTimeout (overrun or abort) and the dispatcher's force-stop after an abort called Process.Kill(), which ends only the program itself. Anything it started kept running, holding its output open, until the script exited. They now use Stop-PkProcessTree, like the batch timeout already does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 28, 2026
The force-stop after an abort ran taskkill once per job, waiting for each before the next, which added seconds with many programs still running. Stop-PkProcessTree now takes several processes and kills all their trees in one taskkill call; the dispatcher's force-stop and teardown paths use that through Stop-PkJobProcesses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
HalRiveria
added a commit
that referenced
this pull request
Oct 28, 2026
…cessTree Brings in the process-tree kill changes and the global functions so the help describes the behaviour they add: Stop-PkProcessTree takes several programs, and Invoke-PkProcessWithTimeout / the dispatcher's force-stop kill a program's children too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…artly fails With several PIDs, taskkill exits non-zero if any one was already gone (it exited a moment before, or was taken by another listed tree), even though it killed the rest, so the call returned $false. It now counts the call as having killed them if any listed process is gone afterwards. The race itself can't be set up on demand in the harness; a new assertion covers a parent and its child passed together. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What was wrong. Two places still called
Process.Kill(), which ends only the program itself:Invoke-PkProcessWithTimeout, when a program overran or the run was aborted;If the program had started others (a
.cmdwrapper, a tool with worker processes), they kept running and holding its output open until the script exited. The batch timeout from #9 already killed the whole tree; these didn't.What changed. All of them now use
Stop-PkProcessTree(taskkill /T, falling back toKill()). The dispatcher calls are wrapped as before, since a custom starter's.Procmay not be aProcess. The README's FAQ line about stopping programs says it includes anything they started.Testing. Two new assertions start
cmd /c pingand check by command line that nopingsurvives:Invoke-PkProcessWithTimeoutoverrun;Both fail against
mainand pass here. 219 assertions pass on Windows PowerShell 5.1 and PowerShell 7.6. Merges cleanly with #13.🤖 Generated with Claude Code