You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
http/2 responses without content length headers can cause timeouts #4496
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
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.
$ ./curl -m5 -Z https://domisc-01.server.tvdw.eu/curl-{1..1000} >/dev/null
DL% UL% Dled Uled Xfers Live Qd Total Current Left Speed
-- -- 12103 0 1000 2 67 --:--:-- 0:00:05 --:--:-- 2414 curl: (28) Operation timed out after 5001 milliseconds with 0 out of 0 bytes received
curl: (28) Operation timed out after 5000 milliseconds with 0 out of 0 bytes received
-- -- 12103 0 1000 0 67 --:--:-- 0:00:05 --:--:-- 2414
Tested it from several networks and computers this time just to be sure. With this iteration of the code I'm able to reproduce it from a network ~150ms away as well.
Activity
bagder commentedon Oct 16, 2019
I ran your example code and after running for some time it ended as you described, which I presume then reproduced the problem. I'm on it.
bagder commentedon Oct 17, 2019
@TvdW, do things look better for you with this?
TvdW commentedon Oct 17, 2019
Haha, well, that seems to fix the test case I provided but not my original issue 😄 I'll report back once I know more
TvdW commentedon Oct 17, 2019
So, eh, this happened
Main difference is I updated the Go server to write a few bytes in the output instead of returning an empty response
bagder commentedon Oct 17, 2019
What am I looking for there? I suppose that doesn't trigger the problem for me because I can't see anything fishy...
TvdW commentedon Oct 17, 2019
Oh wow, okay. Back to the drawing board.
fwiw, this is what happens for me:
TvdW commentedon Oct 17, 2019
Some subtle tweaking later, this reproduces it for me again: https://gist.github.com/TvdW/f832c9a7752826c8260e625a77eb6c8d
Tested it from several networks and computers this time just to be sure. With this iteration of the code I'm able to reproduce it from a network ~150ms away as well.
http2: expire a timeout at end of stream
http2_recv: a closed stream trumps pause state
bagder commentedon Oct 18, 2019
Another attempt, this one seems to fix your updated recipe as well!
TvdW commentedon Oct 18, 2019
LGTM! 😃 Thanks!
http2_recv: a closed stream trumps pause state