Skip to content

Commit

Permalink
http2: terminate await request cancel goroutine on conn close
Browse files Browse the repository at this point in the history
If conn closes but the request cancel select is still blocked
we must close the connection wait channel.

Updates golang/go#24776 (needs bundle into std for fix)

Change-Id: I7e3ffdf2dd9b127727e24fe262b2f4c5d96fc184
Reviewed-on: https://go-review.googlesource.com/108415
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
  • Loading branch information
meirf authored and bradfitz committed Apr 20, 2018
1 parent d41e817 commit 5f9ae10
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions http2/transport.go
Expand Up @@ -951,6 +951,9 @@ func (cc *ClientConn) awaitOpenSlotForRequest(req *http.Request) error {
for {
cc.lastActive = time.Now()
if cc.closed || !cc.canTakeNewRequestLocked() {
if waitingForConn != nil {
close(waitingForConn)
}
return errClientConnUnusable
}
if int64(len(cc.streams))+1 <= int64(cc.maxConcurrentStreams) {
Expand Down

0 comments on commit 5f9ae10

Please sign in to comment.