Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
EnumX = "4e289a0a-7415-4d19-859d-a7e5c4648b56"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
Preferences = "21216c6a-2e73-6563-6e65-726566657250"
Reseau = "802f3686-a58f-41ce-bb0c-3c43c75bba36"
SHA = "ea8e919c-243c-51af-8825-aaa63cd721ce"
URIs = "5c2747f8-b7ea-4ff2-ba2e-563bfd36b1d4"
Expand All @@ -19,6 +20,7 @@ UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
CodecZlib = "0.7"
EnumX = "1"
PrecompileTools = "1.2.1"
Preferences = "1"
Reseau = "1.1.1"
URIs = "1.6.1"
julia = "1.10"
Expand Down
9 changes: 7 additions & 2 deletions src/precompile.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using PrecompileTools: @setup_workload, @compile_workload
using Preferences: load_preference

# Shared high-level workload used by package precompilation.

Expand Down Expand Up @@ -313,15 +314,15 @@ end
function _run_precompile_workload!()::Nothing
task = Threads.@spawn _run_precompile_workload_inner!()
try
status = IOPoll.timedwait(() -> istaskdone(task), 20.0; pollint = 0.01)
status = Base.timedwait(() -> istaskdone(task), 20.0; pollint = 0.01)
if status == :timed_out
@try_ignore begin
IOPoll.shutdown!()
end
@try_ignore begin
Base.throwto(task, InterruptException())
end
_ = IOPoll.timedwait(() -> istaskdone(task), 2.0; pollint = 0.01)
_ = Base.timedwait(() -> istaskdone(task), 2.0; pollint = 0.01)
error("HTTP precompile workload timed out")
end
fetch(task)
Expand All @@ -335,6 +336,10 @@ end

function _precompile_workload_enabled()::Bool
Base.JLOptions().code_coverage == 0 || return false
# See JuliaWeb/HTTP.jl#1252: on Linux Julia 1.11+, the live precompile
# workload can hang in the Reseau/epoll path, so keep it opt-in there.
default_enabled = !(Sys.islinux() && VERSION >= v"1.11")
load_preference(@__MODULE__, "precompile_workload", default_enabled) || return false
try
return !isempty(HostResolvers.resolve_tcp_addrs("tcp", "localhost:0"))
catch
Expand Down
Loading