diff --git a/control/strategy/pool.go b/control/strategy/pool.go index 01174a41e..f99b0b7bc 100644 --- a/control/strategy/pool.go +++ b/control/strategy/pool.go @@ -361,10 +361,8 @@ func (p *pool) SubscriptionCount() int { } // SelectAP selects an available plugin from the pool +// the method is not thread safety, it should be protected outside of the body func (p *pool) SelectAP(taskID string, config map[string]ctypes.ConfigValue) (AvailablePlugin, serror.SnapError) { - p.RLock() - defer p.RUnlock() - aps := p.plugins.Values() var id string