Skip to content

Commit

Permalink
Merge pull request #507 from osxtest/main
Browse files Browse the repository at this point in the history
Fix onetimepool goroutine leak
  • Loading branch information
Mzack9999 authored Sep 2, 2024
2 parents 40ca4ed + 75b3c49 commit 48931aa
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 48931aa

Please sign in to comment.