Commit 9c5d97f
Konstantin Vlasov
asyncio: Use adjusted clock resolution for next tick
asyncio event loop uses monotonic timer which in many systems is the OS uptime.
With low enough clock resolution (often being 1e-09) and high enough uptime
(~194 days), adding the "clock tick" to the current time hits the floating
point precision limits and does not change the time value.
The comparison then returns invalid result, and tasks scheduled to trigger at
this exact moment are not triggered. They will be triggered only later, at the
next call.
This commit fixes the issue by making sure the "next tick" is adjusted to the
current time's floating point precision. Therefore, end_time is guaranteed to
be incremented.1 parent f31ac36 commit 9c5d97f
1 file changed
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
2022 | 2023 | | |
2023 | 2024 | | |
2024 | 2025 | | |
2025 | | - | |
| 2026 | + | |
| 2027 | + | |
| 2028 | + | |
| 2029 | + | |
2026 | 2030 | | |
2027 | 2031 | | |
2028 | 2032 | | |
| |||
0 commit comments