-
Notifications
You must be signed in to change notification settings - Fork 31.1k
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 remains alive after parent terminates while being debugged #13538
Comments
Yes, the script recursively calls itself, but that's irrelevant to the repro (it's just easier to write/use). |
Also, it may be the underlying cause of #10158 and friends. |
My current workaround is using |
Why would you expect that? Node doesn't kill child processes when the parent process exits, debugger or no debugger. (The kernel does on ^C but that's a different mechanism.) |
I edited the original bug to clarify killing the parent is what I meant. (I know ^C does that iff there are no SIGTERM handlers attached, so I removed that particular instruction.) But here's the behavior I'm expecting:
The issue is likely that of the SIGHUP handler being registered and not killing the process upon reception. |
Still sounds like the wrong expectation to me. When SIGTERM terminates the parent, children get reparented to the grandparent. That's not node-specific, it's traditional UNIX behavior. You mention SIGHUP but that is normally only sent when the controlling tty goes away (nominally, when the user logs out.) Again, not node-specific. |
I competely missed that part (which really changes my expectations here). So I'll go ahead and close this. |
Steps:
Expected:
The child should've been killed along with the parent, with the debugger disconnected.
Observed:
The child remains alive with the debugger at the first line waiting.
The text was updated successfully, but these errors were encountered: