| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
A bug was introduced in nodejs#17704 which meant that subsequent calls to enroll would unset the new _idleTimeout and the enrolled object could never again function as a timer.
|
CI: https://ci.nodejs.org/job/node-test-pull-request/14198/ |
Sorry, something went wrong.
There was a problem hiding this comment.
Very nice
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
|
Point 2 regarding throwing might push this into semver-major territory. |
Sorry, something went wrong.
|
@jasnell It's marked as dont-land on all the other versions for now. The 1st change is fixing a semver-major commit that hasn't landed in any releases yet. For the second change, I'm fine if we want to have it be semver-major. Or we could also see how it does in 10.x and backport if there's a reason to do so. (It does bring us in line with the browsers and the spec.) |
Sorry, something went wrong.
There was a problem hiding this comment.
Ok uh I really think these should be in separate PRs:
Sorry, something went wrong.
| }; | ||
|
|
||
| timers.enroll(enrollObj, 1); | ||
| timers.enroll(enrollObj, 10); |
There was a problem hiding this comment.
More reliable: put the setTimeout before this and then just re-enroll with 1. The list order should guarantee the call order is as we expect without depending on libuv behavior.
Sorry, something went wrong.
There was a problem hiding this comment.
Yeah but I want to indirectly test that it's getting the new value rather than just keeping the old one without depending on checking _idleTimeout. That could be another possible bug that someone could introduce.
Sorry, something went wrong.
One of them fixes a breaking change and the other one, I suppose, is a breaking change (although I would call it a bug fix). Feels kind of unnecessary to open another PR now... |
Sorry, something went wrong.
|
ping @nodejs/tsc since this would ideally make it into 10.x |
Sorry, something went wrong.
|
I definitely think this should make it to v10 as semver-major, given a clean CITGM run |
Sorry, something went wrong.
Think the one above was ok but I'm not 100% certain what's expected and what's not these days, given my absence for the past month and a bit. The CI was fine too. |
Sorry, something went wrong.
|
@apapirovski from what I can tell both were fine, it's just common phrasing to indicate that I'm +1 on landing and that that depends on the CI and citgm being green (which they currently are). As in - if we make changes here (which I don't believe we need to at the moment tbh but others might disagree) we should run CITGM again. |
Sorry, something went wrong.
Haha we got our wires crossed. I think I got what you were saying but was trying to express I'm not 100% certain if the CITGM is actually fine or not since I'm not sure what the baseline is these days. 😆 (Indirectly prodding others to verify it for me...) |
Sorry, something went wrong.
Not separating out breaking changes makes backporting significantly more difficult. |
Sorry, something went wrong.
Yeah but there's nothing to back-port here... one is a fix for a semver-major PR (which is landing in 10.x) and the other is semver-major itself. I would understand if they were going into different release lines but right now there's no chance of that happening. |
Sorry, something went wrong.
|
Oh heh. True. |
Sorry, something went wrong.
|
Re-running the two failed CI subtasks: https://ci.nodejs.org/job/node-test-commit-linux-containered/3658/ |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM. Needs one more TSC approval to land, I think.
Sorry, something went wrong.
Just wondering - Why? |
Sorry, something went wrong.
Breaking changes require sign-off from two TSC members.
(Also: If that text is not sufficiently clear, then that's my fault and let's fix that. I'm 100% certain that the "multiple TSC members" is meant as "approval by at least 2 TSC members is required before landing" because I'm the one who came up with the original language. #7955) |
Sorry, something went wrong.
|
I'd like to think about the breaking change here a bit more still - we already don't follow browser behavior in several places and we aren't obligated to. Our platform is quite different from the browser for long running tasks and I'd like to consider the implications in people's applications a bit more. |
Sorry, something went wrong.
@Fishrock123 If you want to delay landing this to give more time to think about it, please put a red-X "Request Changes" on it. Otherwise, someone using git node land on this isn't going to get notified that it is in fact not yet ready to land. |
Sorry, something went wrong.
|
(Also: It might be helpful if you could give a ballpark for how much longer you'd like to think. Days? Weeks? Something else?) |
Sorry, something went wrong.
I don't think the current behaviour is intuitive. There's no indication that the timer won't get rescheduled just because the callback threw an error. In fact, it's mostly an implementation detail. If someone is swallowing uncaughtException (which they probably shouldn't) or is using domains, then this interval just silently stops executing. In a situation where such an interval is meant to do some async work that is network dependant an error could be as simple as getting the wrong response from another service or something. Doesn't mean the interval should stop executing. |
Sorry, something went wrong.
There was a problem hiding this comment.
I'm convinced our current behavior is better for Node.js.
However, I've not seen any good reasoning why we should adopt the browser way of handling errors in this regard, apart from "to increase compatibility". Can you please make a case for this change apart from "to increase compatibility"?
I'd prefer for the enroll() bug to be on a different PR.
Sorry, something went wrong.
Keep executing it can also cause memory leaks, and sudden behavior changes and bugs exposed in not-well-tested path in code. This is a very edge case: basically we are saying that there is a programmer error (goes to uncaughtException) and the user did not crash their application. This story looks very much like a memory leak to me. |
Sorry, something went wrong.
|
I fundamentally disagree that compatibility with the spec and browsers is a bad thing. Anyway, I'll back out the setInterval rescheduling change from this PR and open a separate one for it. |
Sorry, something went wrong.
|
You got me wrong. I think that increasing compatibility is a good thing but I’m not convinced that potentially adding memory leaks to our users code is worth it. |
Sorry, something went wrong.
|
@mcollina I backed out the change and left the bug fix. Do you mind rescinding the requested changes? Opening another two PRs with two possible solutions to the interval issue. |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
There was a problem hiding this comment.
Still LGTM
Sorry, something went wrong.
|
CI: https://ci.nodejs.org/job/node-test-pull-request/14277/ (one commit was taken out, let's make sure it wasn't crucial to tests passing) |
Sorry, something went wrong.
|
CI failure is unrelated. |
Sorry, something went wrong.
|
Seems like the test is flaky: https://ci.nodejs.org/job/node-test-binary-arm/434/RUN_SUBSET=1,label=pi1-docker/console 05:14:26 not ok 227 parallel/test-timers-enroll-second-time 05:14:26 --- 05:14:26 duration_ms: 3.79 05:14:26 severity: fail 05:14:26 exitcode: 1 05:14:26 stack: |- 05:14:26 (node:14533) [DEP0095] DeprecationWarning: timers.enroll() is deprecated. Please use setTimeout instead. 05:14:26 assert.js:250 05:14:26 throw err; 05:14:26 ^ 05:14:26 05:14:26 AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value: 05:14:26 05:14:26 assert(didCall) 05:14:26 05:14:26 at Object.enrollObj._onTimeout.common.mustCall (/home/iojs/build/workspace/node-test-binary-arm/test/parallel/test-timers-enroll-second-time.js:10:37) 05:14:26 at Object._onTimeout (/home/iojs/build/workspace/node-test-binary-arm/test/common/index.js:467:15) 05:14:26 at ontimeout (timers.js:427:11) 05:14:26 at tryOnTimeout (timers.js:289:5) 05:14:26 at listOnTimeout (timers.js:252:5) 05:14:26 at Timer.processTimers (timers.js:212:10) |
Sorry, something went wrong.
|
Didn't want to check _idleTimeout but I guess there's no other option to avoid flakiness (other than huge timeout values and/or putting it in sequential). Should be fixed. New CI: https://ci.nodejs.org/job/node-test-pull-request/14323/ |
Sorry, something went wrong.
Sorry, something went wrong.
A bug was introduced in #17704 which meant that subsequent calls to enroll would unset the new _idleTimeout and the enrolled object could never again function as a timer. PR-URL: #19936 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
A bug was introduced in #17704 which meant that subsequent calls to enroll would unset the new _idleTimeout and the enrolled object could never again function as a timer. PR-URL: #19936 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
There was a problem hiding this comment.
``
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
This PR resolves one recently introduced bug and one long-standing incompatibility with browser behaviour:
A bug was introduced in a recent semver-major PR which makes it impossible to enroll an already enrolled object. This resolves the issue by keeping the validation function at the top but moving the assignment of the potentially modified msecs below.
Node.js currently doesn't match browser behaviour when it comes to intervals that throw during their execution. In all browsers, the interval continues running but in Node.js it will never be rescheduled after a throw nor will the destroy async hook for that interval fire.
Edit: The second change has been backed out now.
Checklist