Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
x/net/http2: closing a requestBody in the ServerHTTP method drops conn-level flow control #28634
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
I'm happy to explain the logs in more detail. Note that a quick work around for me is to do:
But I think this is a hack since I don't think the http2.Server should break if a http handler closed the body.
Yeah, I think this patch handles an unhandled edge case from #16481:
Applying that to my fork I see my issues go away. I'll work on a contained reproduction sometime next week, although maybe the patch gives you some insight on the issue?
referenced this issue
Dec 8, 2018
(found this via #28204)
We ran into the same issue a few times, and it seems to be exactly as @jared2501 points out -- closing a request body on the server doesn't update the connection flow-control, leading to the connection stalling as the client side thinks it has exhausted the connection flow-control.
I have a repro up:
(Edit: The repro almost always fails on Linux within 100 iterations, but requires a higher number of iterations on other platforms).
The repro does the following in a loop:
It typically breaks in < 50 iterations, but sometimes (probably 5% of the time) makes it through 100 iterations. When it fails, we see a timeout on the echo call. If I remove the
Digging into the code for
The last call nils out the pipe buffer field
Logs from the repro running with
I tried the patch above on a branch, and it seemed to improve the success rate of getting through 100 iterations (probably to 10-20% instead of 5%) but it didn't seem to fix the issue.