JuliaPackaging / BinaryProvider.jl

A reliable binary provider for Julia
Other
43 stars 47 forks source link

Deadlock on Windows on spawning multiple tasks of download and unpack #19

Open KristofferC opened 6 years ago

KristofferC commented 6 years ago

https://github.com/StefanKarpinski/Pkg3.jl/pull/25 attempts to implement asynchronous downloading and unpacking of tarballs for getting the packages.

There was some problems on Windows that resulted in a deadlock

I have made a branch here (with some debug output) https://github.com/KristofferC/Pkg3.jl/tree/kc/winrepro that for me reproduces the problem when running

julia> import Pkg3

<]> # enter pkg repl

pkg> install GLVisualize
.....
......
****************
Packages left to handle:
IdentityRanges scheduled: true
INFO: Installed CoordinateTransformations ─ v0.4.1
[DEADLOCK]

What the debug output is saying is that we have scheduled the package "IdentityRanges" to be downloaded and unpacked here: https://github.com/KristofferC/Pkg3.jl/blob/kc/winrepro/src/Operations.jl#L379 but the put! statement on the next line is never reached. In the function install (https://github.com/KristofferC/Pkg3.jl/blob/kc/winrepro/src/Operations.jl#L248) the acrhive is downloaded and uncompressed. Further debugging suggested that we are stuck waiting for the OutputCollector task to finish and it never does, which is why the blocking take! call at https://github.com/KristofferC/Pkg3.jl/blob/kc/winrepro/src/Operations.jl#L395 never finishes.

Moving to just downloading and unpacking using the generated commands from BinaryProvider worked around the issue, so perhaps there is some problem with the OutputCollector.

I am sorry to not be able to provide a more minimum example. The issue is quite finicky since depending on where I put print statements the pkg command might succeed or not.

FWIW, It seems that it is usually the first task that gets scheduled that gets stuck, if that can help debugging...

staticfloat commented 6 years ago

I've made a few changes to OutputCollector since this initial bug report; does this still happen?

KristofferC commented 6 years ago

I'll have to try again with the branch above but updated BinaryProvider. It might take a bit before I get to it though.