src: check microtasks before running them#29434
Closed
codebytere wants to merge 1 commit intonodejs:masterfrom
Closed
src: check microtasks before running them#29434codebytere wants to merge 1 commit intonodejs:masterfrom
codebytere wants to merge 1 commit intonodejs:masterfrom
Conversation
Collaborator
bnoordhuis
approved these changes
Sep 4, 2019
Member
bnoordhuis
left a comment
There was a problem hiding this comment.
MicrotasksScope::PerformCheckpoint() is basically Isolate::RunMicrotasks() with a nesting guard, right? LGTM if that's the case.
Collaborator
Member
Author
|
@bnoordhuis yep! It just runs conditionally on: |
devnexen
approved these changes
Sep 4, 2019
addaleax
approved these changes
Sep 4, 2019
devsnek
approved these changes
Sep 4, 2019
cjihrig
approved these changes
Sep 4, 2019
Trott
approved these changes
Sep 4, 2019
Member
|
Can't think of a simple/reliable way to test this, so LGTM without one, but commenting in case someone else has an idea. |
lpinca
approved these changes
Sep 4, 2019
BridgeAR
approved these changes
Sep 4, 2019
JungMinu
approved these changes
Sep 6, 2019
Trott
pushed a commit
that referenced
this pull request
Sep 6, 2019
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>
Member
|
Landed in 63b056d |
nornagon
added a commit
to nornagon/node-1
that referenced
this pull request
Sep 16, 2019
This is a continuation of nodejs#29434, rewriting the last remaining call to RunMicrotasks.
4 tasks
targos
pushed a commit
that referenced
this pull request
Sep 20, 2019
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>
6 tasks
Trott
pushed a commit
that referenced
this pull request
Sep 23, 2019
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>
targos
pushed a commit
that referenced
this pull request
Sep 23, 2019
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>
Merged
BridgeAR
pushed a commit
that referenced
this pull request
Sep 25, 2019
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 was referenced Sep 25, 2019
codebytere
added a commit
to electron/electron
that referenced
this pull request
Oct 15, 2019
codebytere
added a commit
to electron/electron
that referenced
this pull request
Oct 15, 2019
codebytere
added a commit
to electron/electron
that referenced
this pull request
Oct 17, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
RunMicrotaskscall to aPerformCheckpointcall, 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