-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
http/2 responses without content length headers can cause timeouts #4496
Comments
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. |
@TvdW, do things look better for you with this? --- a/lib/http2.c
+++ b/lib/http2.c
@@ -846,10 +846,11 @@ static int on_stream_close(nghttp2_session *session, int32_t stream_id,
return NGHTTP2_ERR_CALLBACK_FAILURE;
stream->closed = TRUE;
httpc = &conn->proto.httpc;
drain_this(data_s, httpc);
+ Curl_expire(data_s, 0, EXPIRE_RUN_NOW);
httpc->error_code = error_code;
/* remove the entry from the hash as the stream is now gone */
rv = nghttp2_session_set_stream_user_data(session, stream_id, 0);
if(rv) { |
Haha, well, that seems to fix the test case I provided but not my original issue 😄 I'll report back once I know more |
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 |
What am I looking for there? I suppose that doesn't trigger the problem for me because I can't see anything fishy... |
Oh wow, okay. Back to the drawing board. fwiw, this is what happens for me:
|
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. |
To make sure that transfer is being dealt with. Streams without Content-Length need a final read to notice the end-of-stream state. Reported-by: Tom van der Woerdt Fixes #4496
... and thus should return 0, not EAGAIN. Reported-by: Tom van der Woerdt Fixes #4496
Another attempt, this one seems to fix your updated recipe as well! |
LGTM! 😃 Thanks! |
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
After a few seconds of doing a lot of requests, the code ends with
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.
The text was updated successfully, but these errors were encountered: