Skip to content

Commit

Permalink
fix hctx leakage in addrConn.createTransport
Browse files Browse the repository at this point in the history
  • Loading branch information
carzil committed May 4, 2022
1 parent 78b13f2 commit 9e1c3cb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions clientconn.go
Original file line number Diff line number Diff line change
Expand Up @@ -1256,6 +1256,7 @@ func (ac *addrConn) createTransport(addr resolver.Address, copts transport.Conne
newTr, err := transport.NewClientTransport(connectCtx, ac.cc.ctx, addr, copts, func() { prefaceReceived.Fire() }, onGoAway, onClose)
if err != nil {
// newTr is either nil, or closed.
hcancel()
channelz.Warningf(logger, ac.channelzID, "grpc: addrConn.createTransport failed to connect to %s. Err: %v", addr, err)
return err
}
Expand Down

0 comments on commit 9e1c3cb

Please sign in to comment.