-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
[v14.x] Backport AbortController and friends #38386
[v14.x] Backport AbortController and friends #38386
Commits on Apr 30, 2021
-
lib: initial experimental AbortController implementation
AbortController impl based very closely on: https://github.com/mysticatea/abort-controller Marked experimental. Not currently used by any of the existing promise apis. Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: nodejs#33527 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Configuration menu - View commit details
-
Copy full SHA for 1cff8fd - Browse repository at this point
Copy the full SHA 1cff8fdView commit details -
timers: allow promisified timeouts/immediates to be canceled
Using the new experimental AbortController... Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: nodejs#33833 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Gus Caplan <me@gus.host>
Configuration menu - View commit details
-
Copy full SHA for c86e131 - Browse repository at this point
Copy the full SHA c86e131View commit details -
timers: fix multipleResolves in promisified timeouts/immediates
After successful timer finish the abort event callback would still reject (already resolved promise) upon calling abortController.abort(). Signed-off-by: Denys Otrishko <shishugi@gmail.com> PR-URL: nodejs#33949 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Configuration menu - View commit details
-
Copy full SHA for 290ce9f - Browse repository at this point
Copy the full SHA 290ce9fView commit details -
timers: move promisified timers implementations
Move the promisified timers implementations into a new internal. submodule. Also adds `ref` option to the promisified versions. Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: nodejs#33950 Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for d097171 - Browse repository at this point
Copy the full SHA d097171View commit details -
timers: use AbortController with correct name/message
On the web, `AbortError` is the error name, not the error message. Change the code to match that. PR-URL: nodejs#34763 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 26b7626 - Browse repository at this point
Copy the full SHA 26b7626View commit details -
events: allow use of AbortController with once
Allows an AbortSignal to be passed in to events.once() to cancel waiting on an event. Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: nodejs#34911 Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 268686a - Browse repository at this point
Copy the full SHA 268686aView commit details -
events: allow use of AbortController with on
Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: nodejs#34912 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 51031f3 - Browse repository at this point
Copy the full SHA 51031f3View commit details -
doc: revise AbortSignal text and example using events.once()
Add a line to the example code to clarify what happens if an event is emitted after listening is canceled. Make minor revisions to surrounding text. PR-URL: nodejs#35005 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Configuration menu - View commit details
-
Copy full SHA for affb52d - Browse repository at this point
Copy the full SHA affb52dView commit details -
doc: make AbortSignal text consistent in events.md
Further minor modifications to AbortSignal text in events.md for consistency. PR-URL: nodejs#35005 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Configuration menu - View commit details
-
Copy full SHA for 561d832 - Browse repository at this point
Copy the full SHA 561d832View commit details -
events: make abort_controller event trusted
The AbortController abort event is trusted, currently we fire all events with isTrusted: false. Allow dispatching events internally with `isTrusted: true` and add a test for it. Co-Authored-By: ExE Boss <3889017+ExE-Boss@users.noreply.github.com> Fixes: nodejs#35748 PR-URL: nodejs#35811 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for b389182 - Browse repository at this point
Copy the full SHA b389182View commit details -
lib: let abort_controller target be EventTarget
The AbortController abort event should have EventTarget as a target property of the argument event. PR-URL: nodejs#35869 Refs: https://github.com/web-platform-tests/wpt/blob/master/dom/abort/event.any.js Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for f76ab5a - Browse repository at this point
Copy the full SHA f76ab5aView commit details -
test: integrate abort_controller tests from wpt
Refs: web-platform-tests/wpt#9361 PR-URL: nodejs#35869 Refs: https://github.com/web-platform-tests/wpt/blob/master/dom/abort/event.any.js Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 76cdf87 - Browse repository at this point
Copy the full SHA 76cdf87View commit details -
fs: add support for AbortSignal in readFile
PR-URL: nodejs#35911 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
Configuration menu - View commit details
-
Copy full SHA for dc3d852 - Browse repository at this point
Copy the full SHA dc3d852View commit details -
fs: support abortsignal in writeFile
PR-URL: nodejs#35993 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for ceef7e3 - Browse repository at this point
Copy the full SHA ceef7e3View commit details -
PR-URL: nodejs#35806 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 01d2b67 - Browse repository at this point
Copy the full SHA 01d2b67View commit details -
events: support emit on nodeeventtarget
PR-URL: nodejs#35851 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Ricky Zhou <0x19951125@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 1ca549d - Browse repository at this point
Copy the full SHA 1ca549dView commit details -
events: define event handler as enumerable
PR-URL: nodejs#35931 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 307bebc - Browse repository at this point
Copy the full SHA 307bebcView commit details -
events: support event handlers on prototypes
PR-URL: nodejs#35931 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 902503c - Browse repository at this point
Copy the full SHA 902503cView commit details -
events: define abort on prototype
PR-URL: nodejs#35931 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 6bbd82f - Browse repository at this point
Copy the full SHA 6bbd82fView commit details -
events: fire handlers in correct oder
PR-URL: nodejs#35931 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 7d255e6 - Browse repository at this point
Copy the full SHA 7d255e6View commit details -
events: disabled manual construction AbortSignal
Fixes: nodejs#36064 PR-URL: nodejs#36094 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Andrey Pechkurov <apechkurov@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 0131586 - Browse repository at this point
Copy the full SHA 0131586View commit details -
events: getEventListeners static
PR-URL: nodejs#35991 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 555a5a2 - Browse repository at this point
Copy the full SHA 555a5a2View commit details -
http: add support for abortsignal to http.request
PR-URL: nodejs#36048 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Ricky Zhou <0x19951125@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for e8bd59c - Browse repository at this point
Copy the full SHA e8bd59cView commit details -
http2: add support for AbortSignal to http2Session.request
- Add support - Add test - Docs once PR is up PR-URL: nodejs#36070 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 5ce6f91 - Browse repository at this point
Copy the full SHA 5ce6f91View commit details -
child_process: add AbortSignal support
PR-URL: nodejs#36308 Reviewed-By: Rich Trott <rtrott@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 8277ec1 - Browse repository at this point
Copy the full SHA 8277ec1View commit details -
test: increase execFile abort coverage
Verify that if something different than Abortcontroller.signal is passed to child_process.execFile(), ERR_INVALID_ARG_TYPE is thrown. PR-URL: nodejs#36429 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 6c86e68 - Browse repository at this point
Copy the full SHA 6c86e68View commit details -
child_process: clean event listener correctly
I was working on AbortSignal for spawn and noticed there is a leak in the current code for AbortSignal support in child_process since it removes the wrong listener. I used the new signal as argument feature to make removing the listener easier and added a test. PR-URL: nodejs#36424 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 4f04104 - Browse repository at this point
Copy the full SHA 4f04104View commit details -
child_process: add signal support to spawn
PR-URL: nodejs#36432 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 44a304d - Browse repository at this point
Copy the full SHA 44a304dView commit details -
child_process: support AbortSignal in fork
PR-URL: nodejs#36603 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for b9732d4 - Browse repository at this point
Copy the full SHA b9732d4View commit details -
timers: refactor to use validateAbortSignal
PR-URL: nodejs#36604 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com>
Configuration menu - View commit details
-
Copy full SHA for 130b797 - Browse repository at this point
Copy the full SHA 130b797View commit details -
dgram: support AbortSignal in createSocket
PR-URL: nodejs#37026 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 1b04e63 - Browse repository at this point
Copy the full SHA 1b04e63View commit details -
fs: add AbortSignal support to watch
PR-URL: nodejs#37190 Refs: nodejs#37179 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for ef6af8c - Browse repository at this point
Copy the full SHA ef6af8cView commit details -
fs: fix pre-aborted writeFile AbortSignal file leak
Fix an issue in writeFile where a file is opened, and not closed if the abort signal is aborted after the file was opened but before writing began. PR-URL: nodejs#37393 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 88b3463 - Browse repository at this point
Copy the full SHA 88b3463View commit details -
doc: recommend checking abortSignal.aborted first
Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: nodejs#37714 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for a80d272 - Browse repository at this point
Copy the full SHA a80d272View commit details -
events: add max listener warning for EventTarget
Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: nodejs#36001 Fixes: nodejs#35990 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 6b3a21c - Browse repository at this point
Copy the full SHA 6b3a21cView commit details -
lib: set abort-controller toStringTag
PR-URL: nodejs#36115 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for a2cf563 - Browse repository at this point
Copy the full SHA a2cf563View commit details -
lib: implement AbortSignal.abort()
Refs: whatwg/dom#960 PR-URL: nodejs#37693 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 436a2d2 - Browse repository at this point
Copy the full SHA 436a2d2View commit details -
Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: nodejs#37693 Refs: whatwg/dom#960 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 63099e1 - Browse repository at this point
Copy the full SHA 63099e1View commit details -
lib: add brand checks to AbortController and AbortSignal
PR-URL: nodejs#37720 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 10131cd - Browse repository at this point
Copy the full SHA 10131cdView commit details -
test: fix unreliable test-fs-write-file.js
The test uses a file name twice, causing unreliability in CI. In particular, it's failing a lot on the Raspberry Pi devices. Fixes: nodejs#36090 PR-URL: nodejs#36102 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com>
Configuration menu - View commit details
-
Copy full SHA for 9abc11a - Browse repository at this point
Copy the full SHA 9abc11aView commit details