Unrefed child_process inside a worker thread becomes a zombie #46569
Labels
child_process
Issues and PRs related to the child_process subsystem.
worker
Issues and PRs related to Worker support.
Version
v16.19.0, v18.14.0
Platform
Subsystem
child_process, worker_threads
What steps will reproduce the bug?
If you spawn a child process inside a worker thread, and then unref the child process, the process becomes a zombie when the worker thread exits.
This is a problem if you have a long-running main process that over the course of its lifetime spawns a lot of worker threads, because at some point you run out of PIDs.
index.mjs:
worker.mjs:
How often does it reproduce? Is there a required condition?
Repro'es every time with the provided snippets.
What is the expected behavior?
The child process gets removed from the processes table.
What do you see instead?
in another terminal window:
Additional information
No response
The text was updated successfully, but these errors were encountered: