Skip to content

Commit 64bb0b7

Browse files
authored
Merge pull request #1315 from lwightmoon/master
fix NewConnPool checkMinIdleConns data race
2 parents e63a32f + 3988139 commit 64bb0b7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

internal/pool/pool.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ func NewConnPool(opt *Options) *ConnPool {
9494
closedCh: make(chan struct{}),
9595
}
9696

97+
p.connsMu.Lock()
9798
p.checkMinIdleConns()
99+
p.connsMu.Unlock()
98100

99101
if opt.IdleTimeout > 0 && opt.IdleCheckFrequency > 0 {
100102
go p.reaper(opt.IdleCheckFrequency)

0 commit comments

Comments
 (0)