node
node copied to clipboard
Child Process Leak
I'm spawning processes and using SIGSTOP/SIGCONT to suspend/resume the processes. However, I've noticed that the processes will continue living even after 'close'
having been emitted:
e.g.
# ps -ax | grep ffmpeg | grep 40496
40496 ? Tl 0:05 ffmpeg ...
However, I have received a 'close'
event from the process so it should have exited. I notice that it is in "T" state (stopped by job control signal) which is suspect is somehow related.
It seems to me that the 'close'
event is somehow incorrectly emitted, or that a process can receive a SIGSTOP
after the 'close'
signal.
I could work on this, do you have a repro case? Having two hypothesis makes it a bit complicated
Haven't been able to reproduce. Seems timing dependent.
Workaround is to always use execFile with kill.
Something like cp.execFile('kill')
?