diff --git a/internal/pool/pool.go b/internal/pool/pool.go index a4e6508..25e78aa 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)