Skip to content

Keep the libuv event loop alive during builds - #1453

Closed
maleadt wants to merge 1 commit into
masterfrom
tb/uv-keepalive
Closed

maleadt wants to merge 1 commit into
masterfrom
tb/uv-keepalive

Conversation

@maleadt

@maleadt maleadt commented Sep 15, 2026

Copy link
Copy Markdown
Member

Julia 1.12 can lose the wakeup of the thread that services the libuv event loop: when a worker thread arms IO (Pkg downloads artifacts from a Threads.@spawn task) while thread 0 is parked, nobody runs uv_run again and the download stalls forever with data waiting in the socket. On Yggdrasil this shows up as jobs stuck at "Installing N artifacts" until the 5-hour timeout.

Arm a periodic Timer for the lifetime of build_tarballs when running with more than one thread. An active handle keeps the loop alive, so thread 0 blocks inside uv_run rather than parking and registers new watchers on its next iteration. Remove once the runtime bug is fixed.

Works around JuliaLang/julia#63173.

Julia 1.12 can lose the wakeup of the thread that services the libuv
event loop: when a worker thread arms IO (Pkg downloads artifacts from a
Threads.@Spawn task) while thread 0 is parked, nobody runs uv_run again
and the download stalls forever with data waiting in the socket. On
Yggdrasil this shows up as jobs stuck at "Installing N artifacts" until
the 5-hour timeout.

Arm a periodic Timer for the lifetime of build_tarballs when running
with more than one thread. An active handle keeps the loop alive, so
thread 0 blocks inside uv_run rather than parking and registers new
watchers on its next iteration. Remove once the runtime bug is fixed.

Works around JuliaLang/julia#63173.
@giordano

Copy link
Copy Markdown
Member

sigh. But if it does the job I guess it's good.

@maleadt

maleadt commented Sep 15, 2026

Copy link
Copy Markdown
Member Author

I'm going to try and catch this live on amdci7 first to see if I can debug some more; so don't merge this yet.

@maleadt

maleadt commented Oct 12, 2026

Copy link
Copy Markdown
Member Author

Should be fixed in Julia 1.13.2, so let's upgrade instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants