Skip to content

Commit

Permalink
Fix onetimepool goroutine leak
Browse files Browse the repository at this point in the history
  • Loading branch information
osxtest committed Aug 31, 2024
1 parent 40ca4ed commit 75b3c49
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion conn/connpool/onetimepool.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@ func (p *OneTimePool) Run() error {
}
if err == nil {
p.InFlightConns.Add(conn)
p.idleConnections <- conn
select {
case <-p.ctx.Done():
return p.ctx.Err()
case p.idleConnections <- conn:
}
}
}
}
Expand Down

0 comments on commit 75b3c49

Please sign in to comment.