-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Description
On receiving a 3xx, 4xx, 5xx, etc. response while writing a request body, the HTTP/2 RoundTrip cancels the body write and returns:
https://go.googlesource.com/net/+/3ad01bbaa167859dcfbcce635f3c43f6e900be62/http2/transport.go#1171
In this case, the client does nothing to terminate its side of the stream--it doesn't send END_STREAM or RST_STREAM. The stream will remain open or in a half-closed state until the server resets it.
In addition, we remove the stream from ClientConn.streams in this case, which means we no longer count it against the stream concurrency limit.
We should either send a RST_STREAM when we've given up writing, or write the request body even on a 3xx etc response. (The server can still reset the stream if it doesn't care about the body.)