Skip to content

README: a program started in its parent's first moment can miss the Job Object - #52

Merged
HalRiveria-Bot merged 1 commit into
mainfrom
docs/job-object-gap
Nov 17, 2026
Merged

HalRiveria-Bot merged 1 commit into
mainfrom
docs/job-object-gap

Conversation

@HalRiveria-Bot

Copy link
Copy Markdown
Collaborator

What was wrong: the README promises "programs the script started die with it, even if it's force-closed". But a program is assigned to the kit's kill-on-close Job Object only after Process.Start returns. A child it starts in that window, such as tool.exe under cmd /c tool.exe, isn't in the Job Object, so if the script is killed outright that child keeps running.

What changed: README only. A Limits entry describes the gap and how rare it was in testing, the "No orphans" bullet and the force-close FAQ answer point to it. Ctrl+C, an abort and a timeout aren't affected: they kill each program's whole tree with taskkill. The kit isn't changed. Adding PowerShell's own process to the Job Object would close the gap, but it would also kill anything else the script starts on purpose, such as an app it opens.

Tested (reproduced): a child PowerShell started 200 cmd /c ping trees through Start-PkProcess and was then killed with Stop-Process -Force. Over three runs per runtime, 1 of 600 pings survived on Windows PowerShell 5.1 and none of 600 on PowerShell 7. A separate probe with IsProcessInJob found 1 of 200 pings outside the Job Object on 5.1 with no load, and none of 300 with every core busy, on either runtime.

🤖 Generated with Claude Code

…ob Object

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@HalRiveria-Bot
HalRiveria-Bot merged commit a8b7e0f into main Nov 17, 2026
2 checks passed
@HalRiveria-Bot
HalRiveria-Bot deleted the docs/job-object-gap branch November 17, 2026 03:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants