x/net: http2 server onReadTimeout does not cancel context #57359
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?1.19.3
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?GOARCH="arm64"
GOOS="darwin"
What did you do?
We have a grpc bidi streaming handler that we serve via the server's experimental
ServeHTTP
method. We've found that when a server streaming request comes in, that does not send its first request body longer than the http server'sReadTimeout
, that the context is not closed.What did you expect to see?
For the context to be closed.
What did you see instead?
That operations using that context block forever until we do a read on the body.
I believe this hasn't really come up in practice because it's quite odd to do anything with a request context prior to reading the body. However, in this bidirectional call, it's actually the server that sends the first message (response) and then the client sends the second message in response to the server (a flipping of the client server relationship if you will). We can certainly work around this but it took a very long time to debug why we never saw any cancelation/timeouts happen until our first server write happened that ultimately causes a client side write and then a server side read (which is long dead).
The text was updated successfully, but these errors were encountered: