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

async_hooks: don't set hook_fields[kTotals] to 0 by danbev · Pull Request #19219 · nodejs/node · GitHub

/ node Public

async_hooks: don't set hook_fields[kTotals] to 0 - #19219

Closed
danbev wants to merge 2 commits into
nodejs:masterfrom
danbev:async_hooks_kTotals
Closed

async_hooks: don't set hook_fields[kTotals] to 0#19219
danbev wants to merge 2 commits into
nodejs:masterfrom
danbev:async_hooks_kTotals

Conversation

danbev commented Mar 8, 2018

Copy link
Copy Markdown
Contributor

This commit removes the setting of hook_field[kTotals] to szero in
AsyncHook's enable function.

As far as I can tell this would not be required if the setting of
this field is done with the assignment operator instead of using the
addition assignment operator.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

nodejs-github-bot added the async_hooks Issues and PRs related to the async hooks subsystem. label Mar 8, 2018

danbev commented Mar 8, 2018

Copy link
Copy Markdown
Contributor Author

danbev commented Mar 8, 2018

Copy link
Copy Markdown
Contributor Author
node-test-commit failure looks unrelated

console output:

not ok 876 parallel/test-http2-info-headers-errors
  ---
  duration_ms: 0.342
  severity: fail
  stack: |-
    (node:605) ExperimentalWarning: The http2 module is an experimental API.
  ...

addaleax left a comment

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

LGTM

The way this was previously done was not because setting to 0 was necessary, but because it made the statements in that list consistent, so changing it should not be an issue

apapirovski left a comment

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

If we're doing this — which I'm not a fan of because the chained statement is now much harder to read (the first and second operations are different) — then we should be doing this for disable() too.

The subsystem should be updated to async_hooks rather than src.

danbev added 2 commits March 8, 2018 14:09
This commit removes the setting of hook_field[kTotals] to szero in
AsyncHook's enable function.

As far as I can tell this would not be required if the setting of
this field is done with the assignment operator instead of using the
addition assignment operator.
danbev force-pushed the async_hooks_kTotals branch from 002c636 to 77a9313 Compare March 8, 2018 13:11
danbev changed the title src: remove setting of hook_field[kTotals] to zero async_hooks: don't set hook_fields[kTotals] to 0 Mar 8, 2018

danbev commented Mar 8, 2018

Copy link
Copy Markdown
Contributor Author

@apapirovski I've updated the disable function now and updated the subsystem. Thanks for that.

I know that @addaleax approved this change but I'm getting the feeling that I might be alone in my view regarding that this change is for the better. How about if anyone else chimes in favour of keeping it as it is lets close this.

apapirovski dismissed their stale review March 8, 2018 13:17

Outdated

Copy link
Copy Markdown
Contributor

@danbev Thanks for making the changes. I'm fine with it landing. It's totally possible I'm alone in finding it a bit harder to read :)

danbev commented Mar 11, 2018

Copy link
Copy Markdown
Contributor Author

Landed in ddcc00b.

danbev closed this Mar 11, 2018
danbev added a commit that referenced this pull request Mar 11, 2018
This commit removes the setting of hook_field[kTotals] to szero in
AsyncHook's enable function.

As far as I can tell this would not be required if the setting of
this field is done with the assignment operator instead of using the
addition assignment operator.

PR-URL: #19219
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
danbev deleted the async_hooks_kTotals branch March 11, 2018 15:41
targos pushed a commit that referenced this pull request Mar 17, 2018
This commit removes the setting of hook_field[kTotals] to szero in
AsyncHook's enable function.

As far as I can tell this would not be required if the setting of
this field is done with the assignment operator instead of using the
addition assignment operator.

PR-URL: #19219
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
targos mentioned this pull request Mar 18, 2018
MylesBorins pushed a commit that referenced this pull request Mar 20, 2018
This commit removes the setting of hook_field[kTotals] to szero in
AsyncHook's enable function.

As far as I can tell this would not be required if the setting of
this field is done with the assignment operator instead of using the
addition assignment operator.

PR-URL: #19219
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
MayaLekova pushed a commit to MayaLekova/node that referenced this pull request May 8, 2018
This commit removes the setting of hook_field[kTotals] to szero in
AsyncHook's enable function.

As far as I can tell this would not be required if the setting of
this field is done with the assignment operator instead of using the
addition assignment operator.

PR-URL: nodejs#19219
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
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

async_hooks Issues and PRs related to the async hooks subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants


Back | FazBrowse Home | New Git URL