diff --git a/internal/pool/pool.go b/internal/pool/pool.go index a4e65084..25e78aa3 100644 --- a/internal/pool/pool.go +++ b/internal/pool/pool.go @@ -119,6 +119,10 @@ 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)