-
Notifications
You must be signed in to change notification settings - Fork 30k
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
Improve ChildProcess::killed property behaviour. Or update documentation. #16747
Comments
My take on this is that it is a documentation issue: #16748 |
why not update code ?
Moreover, the |
Updating the code is much more likely to break existing applications in non-obvious ways. The
I'm not saying it's a great name, but this flag is literally indicating the result of calling |
What if we will deprecate this property in the next versions ? I do not see any advantage to use it in that form. That's rudimental functionality. |
This commit changes the wording of subprocess.killed to reflect that a child process was successfully signaled, and not necessarily terminated. Fixes: nodejs#16747 PR-URL: nodejs#16748 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit changes the wording of subprocess.killed to reflect that a child process was successfully signaled, and not necessarily terminated. Fixes: #16747 PR-URL: #16748 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit changes the wording of subprocess.killed to reflect that a child process was successfully signaled, and not necessarily terminated. Fixes: #16747 PR-URL: #16748 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit changes the wording of subprocess.killed to reflect that a child process was successfully signaled, and not necessarily terminated. Fixes: #16747 PR-URL: #16748 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit changes the wording of subprocess.killed to reflect that a child process was successfully signaled, and not necessarily terminated. Fixes: #16747 PR-URL: #16748 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit changes the wording of subprocess.killed to reflect that a child process was successfully signaled, and not necessarily terminated. Fixes: #16747 PR-URL: #16748 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
According to documentation (https://nodejs.org/dist/latest-v9.x/docs/api/child_process.html#child_process_subprocess_killed) the
killed
property has invalid semantic in comparison to ChildProcess::kill method behaviour (internal/child_process.js)Concretely, the problematic code is
After the
this._handle.kill(signal);
method call we have no idea whether the 3-d party process was killed, or it just received a signal, processed it and continues working (it maybe be possible even with such 'kill' signals like SIGINT and SIGTERM).So I propose to discuss what can be done in this direction to improve expected behaviour.
The easiest solution (and maybe the right one) is to move
this.killed = true;
line into_handle.onexit
function and fix to the following code:The if block (1) is needed cuz now documentation says '...indicates whether the child process was successfully terminated using
subprocess.kill()
'. We can eliminate this block, but we will need to update documentation also.Strictly speaking, the
killed
field isn't very helpful in terms of identifying when process will exit.We usually use
exit
event for that. But, nevertheless, it's strange to see childProcess.killed === true, when in reality process works fine.The text was updated successfully, but these errors were encountered: