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

timers: call destroy on interval error by apapirovski · Pull Request #20001 · nodejs/node · GitHub

/ node Public

timers: call destroy on interval error - #20001

Closed
apapirovski wants to merge 2 commits into
nodejs:masterfrom
apapirovski:patch-timers-interval-destroy
Closed

timers: call destroy on interval error#20001
apapirovski wants to merge 2 commits into
nodejs:masterfrom
apapirovski:patch-timers-interval-destroy

Conversation

apapirovski commented Apr 13, 2018
edited
Loading

Copy link
Copy Markdown
Contributor

When an interval callback throws an error, the destroy hook is never called due to a faulty if condition.

This change can be backported unlike the semver-major one in the next PR which would bring us in line with the browsers (and the spec).

CI: https://ci.nodejs.org/job/node-test-pull-request/14244/

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

When an interval callback throws an error, the destroy
hook is never called due to a faulty if condition.
apapirovski added the timers Issues and PRs related to the timers subsystem / setImmediate, setInterval, setTimeout. label Apr 13, 2018

Copy link
Copy Markdown
Contributor Author

/cc @mcollina @Fishrock123 @nodejs/timers

}

process.on('uncaughtException', common.mustCall((err) => {
assert(err.message, 'setInterval Error');

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

This seems to miss .strictEqual.

const hooks = initHooks();
hooks.enable();

// install first timeout

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

Nit: please always use capital letters for the first character of a comment and use punctuation.

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

Was left over from another test for async hooks. It's not a very helpful comment to be honest. Removing.

Copy link
Copy Markdown
Contributor Author

Updated. Another CI: https://ci.nodejs.org/job/node-test-pull-request/14248/

mcollina 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

BridgeAR added the author ready PRs that have at least one approval, no outstanding review comments, and a CI started. label Apr 13, 2018
jasnell requested a review from Fishrock123 April 13, 2018 14:35
apapirovski added this to the 10.0.0 milestone Apr 17, 2018
apapirovski added a commit that referenced this pull request Apr 17, 2018
When an interval callback throws an error, the destroy
hook is never called due to a faulty if condition.

PR-URL: #20001
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>

Copy link
Copy Markdown
Contributor Author

Landed in 4f2000f

@jasnell If this can get into v10.0.0 then great but it's not a must. (It is a small bug-fix tho.)

apapirovski deleted the patch-timers-interval-destroy branch April 17, 2018 14:06
jasnell pushed a commit that referenced this pull request Apr 17, 2018
When an interval callback throws an error, the destroy
hook is never called due to a faulty if condition.

PR-URL: #20001
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.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

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants


Back | FazBrowse Home | New Git URL