FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

process: code cleanup for nextTick by apapirovski · Pull Request #28047 · nodejs/node · GitHub

/ node Public

process: code cleanup for nextTick - #28047

Closed
apapirovski wants to merge 5 commits into
nodejs:masterfrom
apapirovski:next-tick-stuffs
Closed

process: code cleanup for nextTick#28047
apapirovski wants to merge 5 commits into
nodejs:masterfrom
apapirovski:next-tick-stuffs

Conversation

apapirovski commented Jun 4, 2019
edited
Loading

Copy link
Copy Markdown
Contributor

Fix a few edge cases and non-obvious issues with nextTick:

  1. Emit destroy hook in a try-finally rather than triggering it before the callback runs.
  2. Re-word comment for processPromiseRejections and make sure it returns true in the rejectionHandled case too.
  3. Small readability improvements.
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

This comment has been minimized.

Fix a few edge cases and non-obvious issues with nextTick:
1. Emit destroy hook in a try-finally rather than triggering
it before the callback runs.
2. Re-word comment for processPromiseRejections and make sure
it returns true in the rejectionHandled case too.
3. Small readability improvements.

This comment has been minimized.

BridgeAR added author ready PRs that have at least one approval, no outstanding review comments, and a CI started. process Issues and PRs related to the process subsystem. labels Jun 4, 2019

BridgeAR commented Jun 4, 2019

Copy link
Copy Markdown
Member

@apapirovski would it be possible to write a test case for the destroy hook change?

// a warning to be emitted which requires the microtask and next tick
// queues to be drained again.
function processPromiseRejections() {
let maybeScheduledTicksOrMicrotasks = asyncHandledRejections.length > 0;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

On a side note, I wonder if it make sense now to just merge process/promises.js and process/task_queues.js - the latter is currently the only one who requires the former.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Maybe? At the same time it's a little easier to read the task queue code as is. Also, the code in promises isn't really explicitly tied to task queues.

If someone feels strongly, they should open a PR. I, personally, like it as is.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Keep in mind, more files = more startup time.

joyeecheung Jun 7, 2019
edited
Loading

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

@Fishrock123 This is now somewhat negligible since we have shipped pre-built code cache for builtin modules, which eliminates the majority of the overhead of loading an builtin module (compilation) - of course that does not apply to modules like internal/errors.js which does a lot of stuff in the initialization, but that overhead would be eliminated as well when the v8 snapshot integration is completed.

Copy link
Copy Markdown
Contributor Author

@BridgeAR added a test, as requested.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

Trott commented Jun 6, 2019

Copy link
Copy Markdown
Member

Worth a benchmark run?

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

Copy link
Copy Markdown
Collaborator

Trott commented Jun 9, 2019

Copy link
Copy Markdown
Member

pull Bot pushed a commit to whtiehack/node that referenced this pull request Jun 9, 2019
Fix a few edge cases and non-obvious issues with nextTick:
1. Emit destroy hook in a try-finally rather than triggering
it before the callback runs.
2. Re-word comment for processPromiseRejections and make sure
it returns true in the rejectionHandled case too.
3. Small readability improvements.

PR-URL: nodejs#28047
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>

Copy link
Copy Markdown
Contributor Author

Landed in abf765e

apapirovski closed this Jun 9, 2019
apapirovski deleted the next-tick-stuffs branch June 9, 2019 04:54
BridgeAR pushed a commit that referenced this pull request Jun 17, 2019
Fix a few edge cases and non-obvious issues with nextTick:
1. Emit destroy hook in a try-finally rather than triggering
it before the callback runs.
2. Re-word comment for processPromiseRejections and make sure
it returns true in the rejectionHandled case too.
3. Small readability improvements.

PR-URL: #28047
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
BridgeAR mentioned this pull request Jun 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

Labels

author ready PRs that have at least one approval, no outstanding review comments, and a CI started. process Issues and PRs related to the process subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants


Back | FazBrowse Home | New Git URL