Skip to content

Commit

Permalink
Temp changes::
Browse files Browse the repository at this point in the history
  • Loading branch information
aranjans committed Apr 17, 2024
1 parent 73243b6 commit cb9af76
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions internal/transport/http2_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,7 @@ func newHTTP2Client(connectCtx, ctx context.Context, addr resolver.Address, opts
// after draining any remaining incoming data.
t.conn.Close()
}
t.logger.Infof("Closing writerDone channel")
close(t.writerDone)
}()
defer func() {
Expand Down Expand Up @@ -1005,13 +1006,7 @@ func (t *http2Client) Close(err error) {
// ever starts to take in an HTTP/2 error code the peer will be able to get more information about the reason
// behind the connection close.
t.controlBuf.put(&goAway{code: http2.ErrCodeNo, debugData: []byte(fmt.Sprintf("client shutdown with: %v", err)), closeConnErr: err})
ctx, cancel := context.WithTimeout(context.Background(), 20*time.Second)
defer cancel()
select {
case <-t.writerDone:
case <-ctx.Done():
t.logger.Infof("Context timed out")
}
<-t.writerDone
t.cancel()
t.conn.Close()
channelz.RemoveEntry(t.channelz.ID)
Expand Down

0 comments on commit cb9af76

Please sign in to comment.