I'm creating a cluster in nodejs application & at some point I'll need to close all the child process(the cluster workers). I was wondering if calling process.exit(0)
on the master process would be enough to close them all. I tried it & it's seems to work but I want to make sure that this wouldn't cause a memory leak of some kind
The child_process
will continue even if node does not, see below:
NODE:
child_process.exec("sleep 20")
process.exit(0)
BASH:
ps aux | grep "sleep 20"
OUTPUT:
USERNAME PID CPU MEM VSZ RSS TT S STARTED TIME sleep 20
The sleep 20
is still shown as running.