fix(task): kill entire process group on BackgroundTaskRuntime dispose + test:noforce#162
Open
hernandez42 wants to merge 1 commit into
Open
fix(task): kill entire process group on BackgroundTaskRuntime dispose + test:noforce#162hernandez42 wants to merge 1 commit into
hernandez42 wants to merge 1 commit into
Conversation
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.
Summary
Fix BackgroundTaskRuntime subprocess leak and add open-handle detection to test suite.
Changes
src/task/runtime/BackgroundTaskRuntime.tsprocess.kill(-child.pid, signal)to kill the entire process group (negative PID = process group), not just the shell processchild.kill(signal)(TerminateProcess)package.jsontestnow runs without--test-force-exit(natural exit, exposes open handles)test:forceas the old--test-force-exitmodetest:noforceas explicit alias for natural-exit modeWhy this matters
--test-force-exitwas masking open handles from background tasks, file watchers, and MCP connections. Running without it (npm test) now naturally exposes any real leaks:Verification
Co-authored-by: Xuanji xuanji@ouvaton.org