Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
x/net/http2: RST_STREAM ErrCode=CANCEL sent to a closed stream #41570
What version of Go are you using (
@fraenkel Could I provide you more debug information that will help you say why the CANCEL is being send ?
I see all required data: the stream id, the END_STREAM flag and the body/data. But for some reason Golang net::Transport marks it as insufficient/incorrect and sends back the RST_STREAM+CANCEL.
Sorry, I am not so familiar with Golang net internals and I didn't (I still don't) understand whether the problem is in the client (Golang) or in the server (Tomcat).
This same issue (RST_STREAM + CANCEL sent by HTTP2 client to server after reading the DATA frame of a response) was reported with regard to exchange between restic backup and rclone utility: rclone/rclone#2598
The root cause in that case was that restic (client) read exactly the number of response bytes it requested but did not wait for stream EOF. Not waiting for EOF after reading full response body never posed a problem with HTTP/1.1 but results in sporadic RST_STREAM issues with HTTP/2.
The issue was investigated here: https://github.com/ivandeex/rclone/tree/stream-reset/stream-reset#premature-stream-reset-between-restic-and-rclone
prints error messages
is successful again.