Skip to content
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

[v9.x bugfix] timers: fix a bug in error handling #20025

Closed

Conversation

apapirovski
Copy link
Member

This is a bug fix for v9.x that can also be backported to v6.x and v8.x. This was fixed in master via a semver-major commit which can't be backported, at least not until we confirm that it doesn't cause unrelated issues.

When a timeout within a list of timeouts (that consists of only that specific timeout) throws during its execution, it's possible for the TimerWrap handle to become shared between both that list and an unref'd timeout created in the future. This fixes the bug by extending error handling in timeout execution to check for whether the current list is empty and if so do cleanup on it.

Fixes: #19970

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

When a timeout within a list of timeouts (that consists of only
that specific timeout) throws during its execution, it's possible
for the TimerWrap handle to become shared between both that list
and an unref'd timeout created in the future. This fixes the bug
by extending error handling in timeout execution to check for
whether the current list is empty and if so do cleanup on it.
@apapirovski apapirovski added the timers Issues and PRs related to the timers subsystem / setImmediate, setInterval, setTimeout. label Apr 14, 2018
@apapirovski
Copy link
Member Author

@apapirovski
Copy link
Member Author

@nodejs/release Let me know if we're not doing another 9.x release and I'll reopen this against 8.x.

@richardlau
Copy link
Member

cc @nodejs/timers

@apapirovski
Copy link
Member Author

ping @nodejs/release re: above. Should this get reopened against v8.x? Seems like 9.x is not getting another release, unless I'm mistaken.

@apapirovski
Copy link
Member Author

apapirovski commented May 1, 2018

@MylesBorins if you're making an 8.x release, I would appreciate this getting landed on 9.x staging so I can backport it to 8.x for the next release. (This doesn't apply to 10.x as it was fixed via a semver-major PR.)

But let me know if we should just open against 8.x. Not sure the status of 9.x currently.

@MylesBorins
Copy link
Contributor

@apapirovski this should likely target 8.x at this point

@apapirovski apapirovski closed this May 3, 2018
@apapirovski apapirovski deleted the fix-v9.x-timers-bug branch May 3, 2018 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

5 participants