Children from child_process.fork printing outside of parent after parent process.exit #7974
Labels
child_process
Issues and PRs related to the child_process subsystem.
question
Issues that look for answers.
My example demonstrates - what I believe to be - a frustrating extreme to what could be an underlying issue. Copy together the two examples below into the same directory (name the top
parent.js
and the bottomchild.js
- for reproducing's sake.) Open two terminals (the first will become difficult to use...) and runnode parent.js
with the first and wait. While your node application will close, you'll continue to be hit with theconsole.log
from the forked process. This will continue until you kill the child process manually (which, again, can be difficult with the first terminal) so runps aux | grep "node child.js"
with your second terminal, find the forked child's PID and kill it.The prints will not happen if
child.js
is forked with a true silent option or if you exitparent.js
withCtrl+C
- so I don't know if this is a leak of the child's scope or if this is intentional and by design.The text was updated successfully, but these errors were encountered: