* Prevent deadlock on boost * Force a boost in testchannelqueue
This commit is contained in:
parent
5525452bdf
commit
315d928626
2 changed files with 4 additions and 3 deletions
|
@ -25,12 +25,13 @@ func TestChannelQueue(t *testing.T) {
|
||||||
|
|
||||||
queue, err := NewChannelQueue(handle,
|
queue, err := NewChannelQueue(handle,
|
||||||
ChannelQueueConfiguration{
|
ChannelQueueConfiguration{
|
||||||
QueueLength: 20,
|
QueueLength: 0,
|
||||||
Workers: 1,
|
|
||||||
MaxWorkers: 10,
|
MaxWorkers: 10,
|
||||||
BlockTimeout: 1 * time.Second,
|
BlockTimeout: 1 * time.Second,
|
||||||
BoostTimeout: 5 * time.Minute,
|
BoostTimeout: 5 * time.Minute,
|
||||||
BoostWorkers: 5,
|
BoostWorkers: 5,
|
||||||
|
Workers: 0,
|
||||||
|
Name: "TestChannelQueue",
|
||||||
}, &testData{})
|
}, &testData{})
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
|
||||||
|
|
|
@ -96,8 +96,8 @@ func (p *WorkerPool) pushBoost(data Data) {
|
||||||
p.blockTimeout /= 2
|
p.blockTimeout /= 2
|
||||||
p.lock.Unlock()
|
p.lock.Unlock()
|
||||||
}()
|
}()
|
||||||
p.addWorkers(ctx, boost)
|
|
||||||
p.lock.Unlock()
|
p.lock.Unlock()
|
||||||
|
p.addWorkers(ctx, boost)
|
||||||
p.dataChan <- data
|
p.dataChan <- data
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue