-
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
AbortController/AbortSignal Triggering 'Error' Event in Child Process #46036
Comments
I think we should fix the documentation. PR welcome :) /cc @nodejs/child_process |
In regards to how I think
|
The doc does mention AbortController would behave the same way but with the caveat of passing the AbortError
But nonetheless have put PR updating that specific line |
Fixes: nodejs#46036 PR-URL: nodejs#46072 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Version
v18.9.0
Platform
Linux Mint 20.1
Subsystem
child_process
What steps will reproduce the bug?
exit
eventerror
event.The following code will generate the error for
spawn
,execFile
, andexec
How often does it reproduce? Is there a required condition?
This occurs every time, a child process is aborted via AbortSignal and it has not performed it's exit event.
What is the expected behavior?
What do you see instead?
Additional information
According to the documentation a child process
error
event occurs only on:None of these conditions are true when the process is aborted via AbortSignal. If the child process is terminated via a
child.kill( "SIGTERM" )
it does not trigger theerror
event.I am assuming that
AbortSignal.abort()
is suppose to act likechild.kill( "SIGTERM" )
and not that the documentation is out-of-date.The text was updated successfully, but these errors were encountered: