Skip to content

HTTPS GET requests to S3 hang forever when doing a lot of them #517

@quatrix

Description

@quatrix

The following code never finishes:

using HTTP

function main()
    get(i) = begin
        try
            data = HTTP.get("https://public-test-bucket-quatrix.s3.amazonaws.com/signals/10737/1574792548712.wav")

            @info "got" i=i data=size(data.body)
        catch e
            @error "error" exception=e
        end
    end

    asyncmap(get, 1:6000, ntasks=20)
end

main()

while running the following exception pop up

IOError: write: broken pipe (EPIPE)

and sometimes also

ArgumentError: `unsafe_write` requires `iswritable(::SSLContext)`
  1. It usually finishes when running one time, second run hangs forever. so you may want to run it multiple times to reproduce.
  2. Payload size is 150k, it also hangs when downloading a 11 bytes payload, a bit less often, you can by replacing the URL to: https://public-test-bucket-quatrix.s3.amazonaws.com/hey.txt
  3. Runs that don't hang may still have the ArgumentError exception, but not the broken pipe exception.
  4. Changing https to http seems to make it always not hang - with http also tried doubling the iterations and increasing payload to 400k, all finishes many times.
  5. Setting readtimeout=5 doesn't seem to have an effect, it just hangs forever regardless
  6. Changing ntasks to 2, also hangs, but takes more time

I'm testing this from an Azure machine downloading objects from AWS.

this is the output when hitting ctrl+c

┌ Info: got
│   i = 5982
└   data = (155990,)
┌ Info: got
│   i = 5991
└   data = (155990,)



^C
signal (2): Interrupt
in expression starting at /data/repos/research_infra/scripts/reproduce.jl:26
epoll_pwait at /build/glibc-OTsEL5/glibc-2.27/misc/../sysdeps/unix/sysv/linux/epoll_pwait.c:42
uv__io_poll at /workspace/srcdir/libuv/src/unix/linux-core.c:270
uv_run at /workspace/srcdir/libuv/src/unix/core.c:359
jl_task_get_next at /buildworker/worker/package_linux64/build/src/partr.c:448
poptaskref at ./task.jl:660
wait at ./task.jl:667
task_done_hook at ./task.jl:401
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2135 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2305
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1631 [inlined]
jl_finish_task at /buildworker/worker/package_linux64/build/src/task.c:181
start_task at /buildworker/worker/package_linux64/build/src/task.c:669
unknown function (ip: 0xffffffffffffffff)
unknown function (ip: 0xffffffffffffffff)
Allocations: 36707340 (Pool: 36687998; Big: 19342); GC: 80

Julia 1.3.1
HTTP.jl 0.8.12
MbedTLS.jl 0.7.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugclientAbout our HTTP client

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions