Skip to content

Commit

Permalink
stop ConnPool.tryDial goroutine if pool was closed
Browse files Browse the repository at this point in the history
  • Loading branch information
def committed Aug 3, 2017
1 parent a8ee441 commit 7ae26b7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/pool/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ func (p *ConnPool) NewConn() (*Conn, error) {

func (p *ConnPool) tryDial() {
for {
if p.closed() {
return
}
conn, err := p.opt.Dialer()
if err != nil {
p.setLastDialError(err)
Expand Down

0 comments on commit 7ae26b7

Please sign in to comment.