-
-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Closed
Labels
Description
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:
- Only triggers with PIPEWAIT (I've created Please expose CURLOPT_PIPEWAIT in the curl tool #4494 so this can be done with the curl command line in the future)
- Triggers when the server doesn't return a Content-Length header (like parallel h2 requests can occasionally result in timeouts #4043)
- Clearly a race condition: triggers with <20 requests on localhost, takes hundreds of requests against a public server. Adding 50ms delay on the server also hides the problem.
Feel free to hit the server I've set up for this with however many requests are needed to test, it can handle it.
Reactions are currently unavailable