Skip to content

Commit

Permalink
Fix leaked goroutine
Browse files Browse the repository at this point in the history
  • Loading branch information
aranjans committed Mar 11, 2024
1 parent 809175c commit 8af4b0b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/transport/http2_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -1008,11 +1008,12 @@ func (t *http2Client) Close(err error) {
if err1 != nil {
t.logger.Infof("Failed to put goaway to server: %v\n", err1)
}
timer := time.NewTimer(10 * time.Second)
timer := time.NewTimer(2 * time.Second)
defer timer.Stop()
select {
case <-t.goAwaySent.Done():
case <-timer.C:
case <-t.ctx.Done():
}
t.controlBuf.setError(ErrConnClosing)
t.cancel()
Expand Down

0 comments on commit 8af4b0b

Please sign in to comment.