fix(proc): reap codegraph's process tree off Windows via process groups#3787
Merged
Conversation
KillTree off Windows only signalled the direct child, so a launcher whose sub-daemon outlives it (codegraph's bundled node runtime) left orphan grandchildren after exit — the Unix counterpart of the Windows Job Object reaping. StartTracked now starts the child in its own process group (Setpgid) and KillTree kills the whole group with a negative-pid signal; SetProcessGroupKill exposes the same for one-shot children (codegraph init). No-op on Windows, where the Job Object already covers the tree. Co-authored-by: ttmouse <ttmouseg@gmail.com>
SuMuxi66
pushed a commit
to SuMuxi66/DeepSeek-Reasonix
that referenced
this pull request
Jun 10, 2026
…ps (esengine#3787) * fix(proc): reap codegraph's process tree off Windows via process groups KillTree off Windows only signalled the direct child, so a launcher whose sub-daemon outlives it (codegraph's bundled node runtime) left orphan grandchildren after exit — the Unix counterpart of the Windows Job Object reaping. StartTracked now starts the child in its own process group (Setpgid) and KillTree kills the whole group with a negative-pid signal; SetProcessGroupKill exposes the same for one-shot children (codegraph init). No-op on Windows, where the Job Object already covers the tree. Co-authored-by: ttmouse <ttmouseg@gmail.com> * test(proc): lift the reap-poll break into the loop condition (QF1006) --------- Co-authored-by: reasonix <reasonix@deepseek.com> Co-authored-by: ttmouse <ttmouseg@gmail.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.
The Unix/macOS counterpart of the Windows codegraph reaping (#3755). Off Windows,
KillTreeonly signalled the direct child (Process.Kill), so a launcher whose sub-daemon outlives it — codegraph's bundled node runtime — left orphan grandchildren after reasonix exited.StartTrackednow starts the child in its own process group (Setpgid), andKillTreereaps the whole group with a negative-pidSIGKILL(falling back to a direct kill if the child isn't a group leader).SetProcessGroupKillexposes the same for one-shot children started outsideStartTracked(codegraphinit). It's a no-op on Windows, where the Job Object from #3755 already covers the tree, sotransport_stdio.goneeds no change.Adds a
!windowsregression test that a launcher's backgrounded grandchild is reaped via the group, not left alive.Cross-compiles for windows/linux/darwin;
go vetclean. The macOS/Linux test jobs exercise the new path.Closes #3735
Co-authored-by: ttmouse ttmouseg@gmail.com