From 7555ac5659f716ab4159ee0f6ecba1ce2ee4d6e7 Mon Sep 17 00:00:00 2001 From: Andrew Pritchard Date: Sun, 26 Jul 2015 13:16:03 -0700 Subject: [PATCH] Close the header channel if a stream is reset while waiting for headers. --- transport/http2_client.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/transport/http2_client.go b/transport/http2_client.go index 6cac6e82..f9ecb27d 100644 --- a/transport/http2_client.go +++ b/transport/http2_client.go @@ -578,6 +578,10 @@ func (t *http2Client) handleRSTStream(f *http2.RSTStreamFrame) { return } s.state = streamDone + if !s.headerDone { + close(s.headerChan) + s.headerDone = true + } s.statusCode, ok = http2RSTErrConvTab[http2.ErrCode(f.ErrCode)] if !ok { grpclog.Println("transport: http2Client.handleRSTStream found no mapped gRPC status for the received http2 error ", f.ErrCode)