Skip to content
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: add AbortSignal support #36308

Closed

Conversation

@benjamingr
Copy link
Member

@benjamingr benjamingr commented Nov 28, 2020

Support AbortSignal in child_process.execFile.

Bikeshedding:

  • I know everywhere else it's called signal and that it's the web platform guidance - but I think we might want to deviate here and call the parameter abortSignal to prevent confusion with OS signals and killSignal. WDYT?

I will follow up with support in the other child_process APIs like fork and spawn.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
@benjamingr benjamingr requested review from addaleax and jasnell Nov 28, 2020
@benjamingr benjamingr force-pushed the benjamingr:child-process-abort-signal branch Nov 28, 2020
@benjamingr benjamingr marked this pull request as ready for review Nov 29, 2020
@Trott
Copy link
Member

@Trott Trott commented Dec 1, 2020

doc/api/child_process.md Outdated
@@ -330,6 +334,21 @@ getVersion();
function. Any input containing shell metacharacters may be used to trigger
arbitrary command execution.**

If the `AbortSignal` option is enabled, calling `.abort()` on the corresponding

This comment has been minimized.

@Trott

Trott Dec 1, 2020
Member

It's called signal above, right? (I guess this is what your bikeshedding note is about.)

This comment has been minimized.

@benjamingr

benjamingr Dec 1, 2020
Author Member

No I think this is just a mistake on my part unrelated to the bikeshedding?

doc/api/child_process.md Outdated
For example:

Comment on lines 341 to 340

This comment has been minimized.

@Trott

Trott Dec 1, 2020
Member

Suggested change
For example:
@Trott
Trott approved these changes Dec 1, 2020
@Trott Trott added the semver-minor label Dec 1, 2020
@addaleax
Copy link
Member

@addaleax addaleax commented Dec 1, 2020

I, for one, would love more consistency between the different child_process.* methods, so if we could add this to all of the async ones at once or not at all, I think that might be nice (except maybe spawn because that’s “more async” in a way, but then again, why not also spawn? … 🙂 )

@benjamingr
Copy link
Member Author

@benjamingr benjamingr commented Dec 1, 2020

@addaleax I intend to add them to all of the APIs - I just find large'ish PRs are harder to land in Node and get meaningful reviews so I made smaller ones. The idea is to add this to fork and spawn later.

If you feel strongly that it should happen in the same PR I am happy to push the commit that adds it to fork and span here if you will review it (Perhaps I already have a branch with a commit on top of this one that adds it 😅 ).

Otherwise I would rather land this and then land the spawn/fork changes in a follow up PR.

@benjamingr benjamingr force-pushed the benjamingr:child-process-abort-signal branch to 72fac8b Dec 5, 2020
benjamingr added a commit that referenced this pull request Dec 6, 2020
PR-URL: #36308
Reviewed-By: Rich Trott <rtrott@gmail.com>
@benjamingr
Copy link
Member Author

@benjamingr benjamingr commented Dec 6, 2020

Landed in 20de5f7 will follow up shortly with form and spawn

@benjamingr benjamingr closed this Dec 6, 2020
@benjamingr benjamingr deleted the benjamingr:child-process-abort-signal branch Dec 6, 2020
@benjamingr
Copy link
Member Author

@benjamingr benjamingr commented Dec 6, 2020

I think somehow ncu pushed something that shouldn't have been here - investigating

@benjamingr
Copy link
Member Author

@benjamingr benjamingr commented Dec 6, 2020

It looks like indeed this landed after last CI since I squashed, somehow this change that wasn't in the original (and commits) and didn't go through CI got in.

This is probably a PBKAC on my part and I landed the squashed commit with NCU

@benjamingr benjamingr mentioned this pull request Dec 6, 2020
4 of 4 tasks complete
danielleadams added a commit that referenced this pull request Dec 7, 2020
PR-URL: #36308
Reviewed-By: Rich Trott <rtrott@gmail.com>
@danielleadams danielleadams mentioned this pull request Dec 7, 2020
danielleadams added a commit that referenced this pull request Dec 7, 2020
PR-URL: #36435

Notable changes:

* child_processes:
  * add AbortSignal support (Benjamin Gruenbaum) (#36308)
* deps:
  * update ICU to 68.1 (Michaël Zasso) (#36187)
* events:
  * support signal in EventTarget (Benjamin Gruenbaum) (#36258)
  * graduate Event, EventTarget, AbortController (James M Snell) (#35949)
* http:
  * enable call chaining with setHeader() (pooja d.p) (#35924)
* module:
  * add isPreloading indicator (James M Snell) (#36263)
* stream:
  * support abort signal (Benjamin Gruenbaum) (#36061)
  * add FileHandle support to Read/WriteStream (Momtchil Momtchev) (#35922)
* worker:
  * add experimental BroadcastChannel (James M Snell) (#36271)
cjihrig added a commit to cjihrig/node that referenced this pull request Dec 8, 2020
PR-URL: nodejs#36308
Reviewed-By: Rich Trott <rtrott@gmail.com>
danielleadams added a commit that referenced this pull request Dec 9, 2020
PR-URL: #36435

Notable changes:

* child_processes:
  * add AbortSignal support (Benjamin Gruenbaum) (#36308)
* deps:
  * update ICU to 68.1 (Michaël Zasso) (#36187)
* events:
  * support signal in EventTarget (Benjamin Gruenbaum) (#36258)
  * graduate Event, EventTarget, AbortController (James M Snell) (#35949)
* http:
  * enable call chaining with setHeader() (pooja d.p) (#35924)
* module:
  * add isPreloading indicator (James M Snell) (#36263)
* stream:
  * support abort signal (Benjamin Gruenbaum) (#36061)
  * add FileHandle support to Read/WriteStream (Momtchil Momtchev) (#35922)
* worker:
  * add experimental BroadcastChannel (James M Snell) (#36271)
danielleadams added a commit that referenced this pull request Dec 9, 2020
PR-URL: #36435

Notable changes:

* child_processes:
  * add AbortSignal support (Benjamin Gruenbaum) (#36308)
* deps:
  * update ICU to 68.1 (Michaël Zasso) (#36187)
* events:
  * support signal in EventTarget (Benjamin Gruenbaum) (#36258)
  * graduate Event, EventTarget, AbortController (James M Snell) (#35949)
* http:
  * enable call chaining with setHeader() (pooja d.p) (#35924)
* module:
  * add isPreloading indicator (James M Snell) (#36263)
* stream:
  * support abort signal (Benjamin Gruenbaum) (#36061)
  * add FileHandle support to Read/WriteStream (Momtchil Momtchev) (#35922)
* worker:
  * add experimental BroadcastChannel (James M Snell) (#36271)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants