Unverified Commit 315d9286 authored by zeripath's avatar zeripath Committed by GitHub
Browse files

Fix Workerpool deadlock (#10283) (#10284)

* Prevent deadlock on boost

* Force a boost in testchannelqueue
Showing with 4 additions and 3 deletions
+4 -3
......@@ -25,12 +25,13 @@ func TestChannelQueue(t *testing.T) {
queue, err := NewChannelQueue(handle,
ChannelQueueConfiguration{
QueueLength: 20,
Workers: 1,
QueueLength: 0,
MaxWorkers: 10,
BlockTimeout: 1 * time.Second,
BoostTimeout: 5 * time.Minute,
BoostWorkers: 5,
Workers: 0,
Name: "TestChannelQueue",
}, &testData{})
assert.NoError(t, err)
......
......@@ -96,8 +96,8 @@ func (p *WorkerPool) pushBoost(data Data) {
p.blockTimeout /= 2
p.lock.Unlock()
}()
p.addWorkers(ctx, boost)
p.lock.Unlock()
p.addWorkers(ctx, boost)
p.dataChan <- data
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment