diff --git a/pkg/container/pool/list.go b/pkg/container/pool/list.go index 97e9afc5c..ec40fca6a 100644 --- a/pkg/container/pool/list.go +++ b/pkg/container/pool/list.go @@ -50,7 +50,7 @@ func NewList(c *Config) *List { // Reload reload config. func (p *List) Reload(c *Config) error { p.mu.Lock() - p.startCleanerLocked(time.Duration(c.IdleTimeout)) + //p.startCleanerLocked(time.Duration(c.IdleTimeout)) p.conf = c p.mu.Unlock() return nil diff --git a/pkg/container/pool/slice.go b/pkg/container/pool/slice.go index 6876565ed..8a02b509f 100644 --- a/pkg/container/pool/slice.go +++ b/pkg/container/pool/slice.go @@ -61,7 +61,7 @@ func NewSlice(c *Config) *Slice { // Reload reload config. func (p *Slice) Reload(c *Config) error { p.mu.Lock() - p.startCleanerLocked(time.Duration(c.IdleTimeout)) + //p.startCleanerLocked(time.Duration(c.IdleTimeout)) p.setActive(c.Active) p.setIdle(c.Idle) p.conf = c @@ -260,7 +260,6 @@ func (p *Slice) openNewItem(ctx context.Context) { // // If n <= 0, no idle items are retained. func (p *Slice) setIdle(n int) { - p.mu.Lock() if n > 0 { p.conf.Idle = n } else { @@ -278,7 +277,6 @@ func (p *Slice) setIdle(n int) { closing = p.freeItem[maxIdle:] p.freeItem = p.freeItem[:maxIdle] } - p.mu.Unlock() for _, c := range closing { c.close() } @@ -293,13 +291,11 @@ func (p *Slice) setIdle(n int) { // If n <= 0, then there is no limit on the number of open items. // The default is 0 (unlimited). func (p *Slice) setActive(n int) { - p.mu.Lock() p.conf.Active = n if n < 0 { p.conf.Active = 0 } syncIdle := p.conf.Active > 0 && p.maxIdleItemsLocked() > p.conf.Active - p.mu.Unlock() if syncIdle { p.setIdle(n) }