Skip to content

Download hang #95

@fredrikekre

Description

@fredrikekre

I think JuliaLang/Pkg.jl#2337 and JuliaLang/Pkg.jl#2287 is still happening and I think the problem was that the server didn't send data (e.g. #85). I can reliably reproduce the hang with this snippet:

#!/usr/bin/env julia

import Downloads

n_concurrent_dls = 4

const jobs = Channel{String}(n_concurrent_dls)

const urls = "https://github.com/JuliaBinaryWrappers/gmsh_jll.jl/releases/download/gmsh-v4.7.1+2/" .* [
    "gmsh.v4.7.1.aarch64-linux-gnu-cxx03.tar.gz",
    "gmsh.v4.7.1.aarch64-linux-gnu-cxx11.tar.gz",
    "gmsh.v4.7.1.aarch64-linux-musl-cxx03.tar.gz",
    "gmsh.v4.7.1.aarch64-linux-musl-cxx11.tar.gz",
    "gmsh.v4.7.1.armv7l-linux-gnueabihf-cxx03.tar.gz",
    "gmsh.v4.7.1.armv7l-linux-gnueabihf-cxx11.tar.gz",
    "gmsh.v4.7.1.armv7l-linux-musleabihf-cxx03.tar.gz",
    "gmsh.v4.7.1.armv7l-linux-musleabihf-cxx11.tar.gz",
    "gmsh.v4.7.1.i686-linux-gnu-cxx03.tar.gz",
    "gmsh.v4.7.1.i686-linux-gnu-cxx11.tar.gz",
    "gmsh.v4.7.1.i686-linux-musl-cxx03.tar.gz",
    "gmsh.v4.7.1.i686-linux-musl-cxx11.tar.gz",
    "gmsh.v4.7.1.i686-w64-mingw32-cxx03.tar.gz",
    "gmsh.v4.7.1.i686-w64-mingw32-cxx11.tar.gz",
    "gmsh.v4.7.1.powerpc64le-linux-gnu-cxx03.tar.gz",
    "gmsh.v4.7.1.powerpc64le-linux-gnu-cxx11.tar.gz",
    "gmsh.v4.7.1.x86_64-apple-darwin.tar.gz",
    "gmsh.v4.7.1.x86_64-linux-gnu-cxx03.tar.gz",
    "gmsh.v4.7.1.x86_64-linux-gnu-cxx11.tar.gz",
    "gmsh.v4.7.1.x86_64-linux-musl-cxx03.tar.gz",
    "gmsh.v4.7.1.x86_64-linux-musl-cxx11.tar.gz",
    "gmsh.v4.7.1.x86_64-unknown-freebsd.tar.gz",
    "gmsh.v4.7.1.x86_64-w64-mingw32-cxx03.tar.gz",
    "gmsh.v4.7.1.x86_64-w64-mingw32-cxx11.tar.gz",
]

producer = @async begin
    for i = 1:5
        for url in urls
            put!(jobs, url)
            put!(jobs, url)
            # put!(jobs, url)
            # put!(jobs, url)
        end
    end
    close(jobs)
end

@sync begin
    for i in 1:n_concurrent_dls
        @async begin
            for j in jobs
                @info "Starting downloading..." file=basename(j)
                Downloads.request(j; output=abspath(basename(j)), verbose=true)
                @info "Done downloading..." file=basename(j)
            end
        end
    end
end

which uses 4 concurrent downloads. Note that this is just hitting Amazon servers so this is unrelated to any PkgServer issues.

After a while it just hangs, and from curl verbose mode I see

* stopped the pause stream!
* stopped the pause stream!
* stopped the pause stream!
* stopped the pause stream!
* Connection #4 to host github-releases.githubusercontent.com left intact

and it hangs forever.

Interupting this gives:

* Connection #4 to host github-releases.githubusercontent.com left intact
^C
signal (2): Interrupt
in expression starting at /home/fredrik/dev/Downloads/run.jl:48
epoll_wait at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
uv__io_poll at /workspace/srcdir/libuv/src/unix/linux-core.c:309
uv_run at /workspace/srcdir/libuv/src/unix/core.c:379
jl_task_get_next at /home/fredrik/julia16/src/partr.c:472
poptask at ./task.jl:755
wait at ./task.jl:763 [inlined]
wait at ./condition.jl:106
take_buffered at ./channels.jl:389
take! at ./channels.jl:383 [inlined]
iterate at ./channels.jl:465
#12 at ./task.jl:406
unknown function (ip: 0x7f31dd5b1d8c)
_jl_invoke at /home/fredrik/julia16/src/gf.c:2238 [inlined]
jl_apply_generic at /home/fredrik/julia16/src/gf.c:2420
jl_apply at /home/fredrik/julia16/src/julia.h:1703 [inlined]
start_task at /home/fredrik/julia16/src/task.c:839
unknown function (ip: (nil))
unknown function (ip: (nil))

as in the other issues linked above.

Might be related to #94, I created the snippet above in an attempt to reproduce the error there, but I can't. Elliot could though (with the same snippet) for some reason.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions