-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Timers sometimes fire early on Windows #8960
Comments
Just got a timer to fire -1.25ms early on the io.js CI...: |
@orangemocha Do you have an idea of how often this problem can be reproduced on Windows? Basically, is there anything we need to know to be able to reproduce it (Windows version, etc.)? |
@trevnorris mentioned that he thought the time was in |
Also, we had an interesting post that i'm going to attempt to look into (with my limited C knowledge) about QPC floating-point rounding issues: nodejs/node#1272 (comment) |
The test output is actually in ms, not us. |
This is also flaky in v0.10 (and a2f879f marked it so). |
uv_poll should wait for at least the full timeout duration when there is nothing else to do. This was not happening because GetQueuedCompletionStatus can occasionally return up to 15ms early. The added test reproduces https://github.com/joyent/node/blob/d13d7f74d794340ac5e126cfb4ce507fe0f803d5/test/simple/test-timers-first-fire.js on libuv, being flaky before this fix. Fix: nodejs/node-v0.x-archive#8960
uv_poll should wait for at least the full timeout duration when there is nothing else to do. This was not happening because GetQueuedCompletionStatus can occasionally return up to 15ms early. The added test reproduces https://github.com/joyent/node/blob/d13d7f74d794340ac5e126cfb4ce507fe0f803d5/test/simple/test-timers-first-fire.js on libuv, being flaky before this fix. Fix: nodejs/node-v0.x-archive#8960
uv_poll should wait for at least the full timeout duration when there is nothing else to do. This was not happening because GetQueuedCompletionStatus can occasionally return up to 15ms early. The added test reproduces https://github.com/joyent/node/blob/d13d7f74d794340ac5e126cfb4ce507fe0f803d5/test/simple/test-timers-first-fire.js on libuv, being flaky before this fix. Fix: nodejs/node-v0.x-archive#8960
Fixes: nodejs#5737 Fixes: nodejs#4643 Fixes: nodejs#4291 Fixes: nodejs/node-v0.x-archive#8960 Refs: nodejs#3594 PR-URL: nodejs#5994
Fixes: nodejs#5737 Fixes: nodejs#4643 Fixes: nodejs#4291 Fixes: nodejs/node-v0.x-archive#8960 Refs: nodejs#3594 PR-URL: nodejs#5994 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Test simple/test-timers-first-fire.js occasionally fails on Windows, because timers fire early. I have seen the timer in the test fire up to 15ms early.
This was supposed to be fixed for the most part by joyent/libuv@6ced8c2 and for small rounding errors by #7211.
When I opened the original PR against libuv (joyent/libuv#1165) it did fix the issue, but I guess that by the time it was accepted and finally merged into node (c5f5d4c) something else must have changed that still causes timers to fire early.
The text was updated successfully, but these errors were encountered: