-
fix(core): kill child process tree in different running tasks (#33636)
发布于
2025-11-27 17:49:19 +00:00 Current Behavior
When Nx commands finish or receive termination signals (SIGINT, SIGTERM,
SIGHUP), child processes spawned by continuous tasks (such asnx serve) can remain orphaned in certain scenarios. This happens because
only the direct child process is killed usingchildProcess.kill(),
leaving grandchild processes running.Expected Behavior
When Nx terminates, all processes in the spawned process tree should be
properly terminated and no orphaned processes should remain.Related Issue(s)
Changes
- Updated signal handlers in
RunningNodeProcessto usethis.kill()
instead ofthis.childProcess.kill(), leveraging the existing
tree-killimplementation - Added
tree-killtoNodeChildProcessWithNonDirectOutputand
NodeChildProcessWithDirectOutputkill methods to ensure entire process
trees are terminated
(cherry picked from commit
21783402b7)下载附件
- Updated signal handlers in