Skip to content

http/2 responses without content length headers can cause timeouts #4496

@TvdW

Description

@TvdW

This is a continuation of #4043, I guess. A slightly more parallel version of the code from that issue can trigger this bug.

Code: https://gist.github.com/TvdW/b07e146eb648fd5ba05f70e87dee0a3b

curl 7.67.0-DEV (x86_64-unknown-linux-gnu) libcurl/7.67.0-DEV OpenSSL/1.0.2k-fips zlib/1.2.7 brotli/1.0.1 c-ares/1.15.0 nghttp2/1.39.1
Release-Date: [unreleased]
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS brotli Debug GSS-API HTTP2 HTTPS-proxy IPv6 Kerberos Largefile libz NTLM NTLM_WB SPNEGO SSL TrackMemory UnixSockets

After a few seconds of doing a lot of requests, the code ends with

* Operation timed out after 5005 milliseconds with 0 bytes received
* Kill stream: Disconnected with pending data
* multi_done
* stopped the pause stream!
* Connection still in use 1, no more multi_done now!
* Operation timed out after 5004 milliseconds with 0 bytes received
* Kill stream: Disconnected with pending data

This does appear to be a race condition, though, in which data must come back before all requests have been submitted. The server listed in the .c snippet runs in an Amsterdam datacenter, but if that's too far then the Go code for it is at https://gist.github.com/TvdW/d90c1b6d69d140e274b8d0eb7788e623

Some things I've noticed:

Feel free to hit the server I've set up for this with however many requests are needed to test, it can handle it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions