x/net/http2: internal error: attempt to send frame on a closed stream #56940
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
)?amd64 linux
What did you do?
This is not an easy issue to reproduce because it seems requiring a lot of concurrency and high load of requests.
Under such high load scenario, we observe a panic in the go routine that is serving the http2 connection.
Because this panic occurs in the path of the serve(), and there is no panic recover, when it occurs, the connection is closed.
However, if the panic occurred in the scope of the runHandler, it would have been caught and recovered.
So, it is not clear to me why this particular is not covered by a panic handler.
Looking into the specific case, it seems that what is happening is that some frames are being queued to be written, and in parallel something triggered the close of a stream.
During the loop of the serve() method, frames are dequeued to be written, which encounter a frame for a stream that was already closed, thus resulting in the panic.
What did you expect to see?
The connection just fails because the panic occurs in the execution path of the serve() which doesn't recover from panics as it occurs if it was done within the runHandler method.
The http2 connection to recover from the panic and keep the http2 connection in a stable state and reusable.
What did you see instead?
The text was updated successfully, but these errors were encountered: