Skip to content

Stop compensating for early Timer in libuv#57264

Open
jakobnissen wants to merge 1 commit into
JuliaLang:masterfrom
jakobnissen:timer_offset
Open

Stop compensating for early Timer in libuv#57264
jakobnissen wants to merge 1 commit into
JuliaLang:masterfrom
jakobnissen:timer_offset

Conversation

@jakobnissen

Copy link
Copy Markdown
Member

It appears to have been fixed on the libuv side, so now Julia's timers are one millisecond too slow.

Closes #57263

It appears to have been fixed on the libuv side, so now Julia's timers are
one millisecond too slow.
@Keno

Keno commented Feb 5, 2025

Copy link
Copy Markdown
Member

Do we speculate this is fixed or do we know that it is fixed? The reason I ask is because the argument is supposed to be a hard floor, so if it wasn't fixed, this would give incorrect behavior (timing out late is suboptimal but not incorrect according to the spec of the function).

@jakobnissen

Copy link
Copy Markdown
Member Author

I only speculate, after seeing on my computer that Julia's timer is 1 ms too long. I'll try to look into libuv and see if I can find anything.

@vtjnash

vtjnash commented Feb 5, 2025

Copy link
Copy Markdown
Member

It was introduced by 7310f55, I think as a workaround because of problems with the original implementation of sleep rounding timeouts down (471828a)?

@martinholters

Copy link
Copy Markdown
Member

It seems that from e5496e0 (#49937) on, the extra 1ms is no longer needed, at least on my system. So indeed, there might have happened a fix in libuv, somewhere between 1.44.2 and 1.48.0. Would still be good to identify the fix over there and verify it is robust and cross-platform.

@vtjnash

vtjnash commented Feb 6, 2025

Copy link
Copy Markdown
Member
  • win,unix: change execution order of timers (Trevor Norris)
    Perhaps? Nothing else mentions timers that I see

@inkydragon inkydragon added the external dependencies Involves LLVM, OpenBLAS, or other linked libraries label Feb 7, 2025
@martinholters

Copy link
Copy Markdown
Member

Bisecting libuv brought me to libuv/libuv@00357f8 (libuv/libuv#4026), which BTW is not contained in any libuv releases, yet. Someone else (@vtjnash ?) has to judge whether that's a proper, reliable fix for the timer-firing-early bug.

@jakobnissen

Copy link
Copy Markdown
Member Author

This appears to have been fixed on Julia 1.12, so closing

@jakobnissen jakobnissen closed this May 1, 2025
@jakobnissen

Copy link
Copy Markdown
Member Author

Nevermind, it was just a change in the result of BenchmarkTools

@jakobnissen jakobnissen reopened this May 1, 2025
@vtjnash

vtjnash commented May 1, 2025

Copy link
Copy Markdown
Member

libuv bug (with reproducer script) filed as libuv/libuv#4773

@DilumAluthge

Copy link
Copy Markdown
Member

This PR has had no activity for over six months.

@jakobnissen Are you still interested in working on this PR?

If you're no longer interested in working on this PR, no worries! Just let me know, and I can close it.

@Keno

Keno commented Feb 21, 2026

Copy link
Copy Markdown
Member

This PR doesn't work as is, because the libuv bug still exists. That needs to be fixed first and then this PR needs to be applied.

@DilumAluthge DilumAluthge added upstream The issue is with an upstream dependency, e.g. LLVM status: blocked by upstream and removed status: waiting for PR author labels Feb 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external dependencies Involves LLVM, OpenBLAS, or other linked libraries status: blocked by upstream upstream The issue is with an upstream dependency, e.g. LLVM

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Timer is ~1ms too slow

6 participants