Skip to content

Commit

Permalink
Merge pull request redis#1315 from lwightmoon/master
Browse files Browse the repository at this point in the history
fix NewConnPool checkMinIdleConns data race
  • Loading branch information
vmihailenco authored May 19, 2020
2 parents e63a32f + 3988139 commit 64bb0b7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/pool/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ func NewConnPool(opt *Options) *ConnPool {
closedCh: make(chan struct{}),
}

p.connsMu.Lock()
p.checkMinIdleConns()
p.connsMu.Unlock()

if opt.IdleTimeout > 0 && opt.IdleCheckFrequency > 0 {
go p.reaper(opt.IdleCheckFrequency)
Expand Down

0 comments on commit 64bb0b7

Please sign in to comment.