| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
The test does not fail without this change. Are we not able to reliably reproduce an issue that this change addresses?
Sorry, something went wrong.
|
@Trott The test failed in v13.0.0-pre and master const timer = setTimeout(() => {
console.log(1); // emit once
}, 1);
setTimeout(() => {
timer.refresh();
}, 1);
This should be printed twice. edited: I will change about a valid example during the day, I am too tired. AM4.00... |
Sorry, something went wrong.
It only prints once for me. Perhaps it is platform and/or environment dependent? |
Sorry, something went wrong.
|
@nodejs/timers |
Sorry, something went wrong.
|
I don't really understand what was incorrect before? |
Sorry, something went wrong.
|
Does this change / fix a problem that could be described as "timer.refresh() does not re-activate a timer which has already timed out"? Does it only change that case? |
Sorry, something went wrong.
I'm well sorry about my English, The most accurate description: When refresh calls a timer that has already been called, the current timer cannot be re-marked as an active event in the event loop. If there is no other event activity, node will exit directly.
Can not... I looked at the 10.x code and it seems to be a bit different.
I think yes, timer[kRefed] is null only after initialization and after invocation(for master). |
Sorry, something went wrong.
Add an or option for put refresh back to work. nodejs#26721 one reason it can't be overridden it only works in the callback of the current timer(before `finally`).
|
Ok I think this may also be fixed by #27345, but this might be able to land sooner / be backported more. cc @apapirovski |
Sorry, something went wrong.
|
If #27345 works well with 10.x, I like it better because it's more like a refactoring, and this one is a bit like monkey patch. |
Sorry, something went wrong.
There was a problem hiding this comment.
To make sure that the test fails on older platforms it's probably useful to start a child process and to log something. That way the main process could verify the output and the broken behavior would be observable.
Sorry, something went wrong.
|
Closing, since #27345 landed. Please leave a comment if this is not fixed by that PR! |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Refresh.() does not get a timer active that has already been invoked. Add an or option for put refresh back to work.
const timer = setTimeout(() => { console.log(1); // emit once }, 1); setTimeout(() => { timer.refresh(); }, 1);#26721 one reason it can't be overridden it only works in the callback of the current timer(before finally).
Checklist