-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
setTimeout is not working properly with non-integer in Node 11 #24203
Comments
/cc @apapirovski |
@nodejs/timers |
Fix the timer logic to be the same as v10.30.0. Fixes: nodejs#24203
Confirmed to still be a bug in Node.js 11.2.0. |
This should be fixed on master. |
@Trott @Fishrock123 Thanks for the confirmation! 😄 |
@Fishrock123 Sorry to say that this is not fixed on master. The code to replicate above still hangs with an executable compiled from current master. |
Oh whoops this wasn't the issue I thought it was... |
Fix the timer logic to be the same as v10.30.0. Fixes: nodejs#24203 PR-URL: nodejs#24214 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Fixed in e9de435 |
Fix the timer logic to be the same as v10.30.0. Fixes: #24203 PR-URL: #24214 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Fix the timer logic to be the same as v10.30.0. Fixes: nodejs#24203 PR-URL: nodejs#24214 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
I have tested
setTimeout
and realized the function seems to have an issue when it is called with non-integer, such as1.1 * 100 (110.00000000000001)
.The function will stop calling a callback function randomly and eat up high CPU usage.
The code is as below,
I also tested it in Node v10, but it seems fine.
The text was updated successfully, but these errors were encountered: