-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
child_process.spawn leaves spawned process hanging #7951
Comments
Can you try removing the |
Yes, same behaviour, updated the script above. |
I should probably note that this is not specific to |
'it' refers to the node process, not the child process? That's the expected behavior, it's how UNIX generally works. EDIT: To be clear, it's expected that the child stays alive when the parent terminates. |
Yes.
Thanks for the clarification. While I understand that UNIX works this way, I feel it would be very beneficial for API to expose a way of saying |
@dignifiedquire Does using https://www.npmjs.com/package/signal-exit present a solution for that problem to you? |
@addaleax thank you 😊 I did not know about that module, this certainly helps with ensuring on listening to the right signal. Thank you everyone for the super quick turn around and help! |
6.3.0
Darwin dignified-station-3.local 15.6.0 Darwin Kernel Version 15.6.0: Thu Jun 23 18:25:34 PDT 2016; root:xnu-3248.60.10~1/RELEASE_X86_64 x86_64
child_process
Given the following code
I would expect the spawned process to be terminated when the execution of it terminates, but this does not seem the case. Checking after this code is executed I find
The text was updated successfully, but these errors were encountered: