-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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 <[email protected]> Reviewed-By: David Carlier <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Minwoo Jung <[email protected]>
Landed in 63b056d |
This is a continuation of nodejs#29434, rewriting the last remaining call to RunMicrotasks.
PR-URL: #29434 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: David Carlier <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Minwoo Jung <[email protected]>
This is a continuation of #29434, rewriting the last remaining call to RunMicrotasks. PR-URL: #29581 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Shelley Vohr <[email protected]> Reviewed-By: Minwoo Jung <[email protected]> Reviewed-By: David Carlier <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
This is a continuation of #29434, rewriting the last remaining call to RunMicrotasks. PR-URL: #29581 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Shelley Vohr <[email protected]> Reviewed-By: Minwoo Jung <[email protected]> Reviewed-By: David Carlier <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
This is a continuation of #29434, rewriting the last remaining call to RunMicrotasks. PR-URL: #29581 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Shelley Vohr <[email protected]> Reviewed-By: Minwoo Jung <[email protected]> Reviewed-By: David Carlier <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
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