-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
src: check microtasks before running them #29434
Conversation
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.
MicrotasksScope::PerformCheckpoint()
is basically Isolate::RunMicrotasks()
with a nesting guard, right? LGTM if that's the case.
@bnoordhuis yep! It just runs conditionally on:
|
Can't think of a simple/reliable way to test this, so LGTM without one, but commenting in case someone else has an idea. |
PR-URL: #29434 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Landed in 63b056d |
This is a continuation of nodejs#29434, rewriting the last remaining call to RunMicrotasks.
PR-URL: #29434 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
This is a continuation of #29434, rewriting the last remaining call to RunMicrotasks. PR-URL: #29581 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Shelley Vohr <codebytere@gmail.com> Reviewed-By: Minwoo Jung <minwoo@nodesource.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This is a continuation of #29434, rewriting the last remaining call to RunMicrotasks. PR-URL: #29581 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Shelley Vohr <codebytere@gmail.com> Reviewed-By: Minwoo Jung <minwoo@nodesource.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This is a continuation of #29434, rewriting the last remaining call to RunMicrotasks. PR-URL: #29581 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Shelley Vohr <codebytere@gmail.com> Reviewed-By: Minwoo Jung <minwoo@nodesource.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Refs electron/electron#20013.
Previously, Node.js unilaterally ran microtasks on next tick; since Electron also handles microtask resolution this created an issue whereby the microtask queue would attempt to be pumped while previous tasks were still running.
To address this issue, i've changed the
RunMicrotasks
call to aPerformCheckpoint
call, which adds checks to only run microtasks if none are in progress, and otherwise proceeds normally.Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes