-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
timers: fix refreshed timers exiting too early #26672
Conversation
If a timer is refreshed in its callback, we should not decrease `refCount` to prevent exiting event loop ahead of time. Fixes: nodejs#26642
@nodejs/timers |
I feel like there should be a better way to do this using existing properties but i’ll Need to check exactly when I am at my computer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is possible without a new property but also the current implementation is broken because the timer ends up "refed" in a way that cannot actually be unrefed later (note that timer[kRefed]
is still set to null
). The destroy hooks will also fire even though they shouldn't.
Closed due to #26721 |
If a timer is refreshed in its callback, we should not decrease
refCount
to prevent exiting event loop ahead of time.Fixes: #26642
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes