Skip to content

Commit fe81bb3

Browse files
committed
And on resume add a zeroboost if necessary
Signed-off-by: Andrew Thornton <[email protected]>
1 parent da695ed commit fe81bb3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

modules/queue/workerpool.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,12 +382,18 @@ func (p *WorkerPool) pause() {
382382
// Resume resumes the WorkerPool
383383
func (p *WorkerPool) Resume() {
384384
p.lock.Lock()
385-
defer p.lock.Unlock()
386385
select {
387386
case <-p.resumed:
387+
p.lock.Unlock()
388388
default:
389389
p.paused = make(chan struct{})
390390
close(p.resumed)
391+
if !p.hasNoWorkerScaling() && p.numberOfWorkers == 0 && atomic.LoadInt64(&p.numInQueue) > 0 {
392+
p.zeroBoost()
393+
// p.zeroBoost will unlock the lock
394+
} else {
395+
p.lock.Unlock()
396+
}
391397
}
392398
}
393399

0 commit comments

Comments
 (0)