-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
doc: refine process.kill() and exit explanations #2918
Conversation
@Trott this addresses all my concerns, thank you for that, LGTM from me |
I'm not sure how fast this can be merged, the other PR was open a couple days, and only @bnoordhuis and I commented, so maybe this could merge quickly, or maybe you should wait until tomorrow in case someone does have opinions. |
@sam-github: I was just typing this:
If you feel really good about it and want to fast-track land it sooner, I don't have a problem with that. If you leave it to me, I'm inclined to give it 24 hours. |
|
||
Note that Windows does not support sending Signals, but Node.js offers some | ||
emulation with `process.kill()`, and `child_process.kill()`. Sending signal `0` | ||
can be used to test for the existence of a process | ||
can be used to test for the existence of a process. Sending `SIGINT`, | ||
`SIGTERM`, and `SIGKILL` cause the unconditional exit of the target process. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless an event handler is listening, in the case of SIGINT and SIGTERM, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes on POSIX systems, but no on Windows. That paragraph applies to Windows only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad, thanks. It does sound to me then that inevitably, Node should strive to unify the behavior. If we can't get Windows to behave, perhaps we need to downgrade the POSIX behavior? (that would suck, but if that's the only way ...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, @sam-github, should I change exit
in line 248 to termination
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, Windows doesn't support signals, so it doesn't support the distinction, but its still more consistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, done.
LGTM |
360b09f
to
7e5eda9
Compare
Removed the |
Add corrections about when exit event fires and how .kill() works on Windows. PR-URL: nodejs#2918 Reviewed-By: Sam Roberts <[email protected]>
Landed in 4dcf24c |
Add corrections about when exit event fires and how .kill() works on Windows. PR-URL: #2918 Reviewed-By: Sam Roberts <[email protected]>
Thanks @Trott. I was afk for a few weeks, so was unable to respond for a while, but appreciate the changes 👍 |
R: @sam-github, @nodejs/documentation
CC: @ronkorving
Ref: #2861
Fix: #2924