DBZ-5272 Notify all threads in case of mutliple writers
This commit is contained in:
parent
e5935d3540
commit
5e1ae24e92
@ -199,7 +199,7 @@ protected void doEnqueue(T record) throws InterruptedException {
|
||||
synchronized (this) {
|
||||
while (queue.size() >= maxQueueSize || (maxQueueSizeInBytes > 0 && currentQueueSizeInBytes >= maxQueueSizeInBytes)) {
|
||||
// notify poll() to drain queue
|
||||
this.notify();
|
||||
this.notifyAll();
|
||||
// queue size or queue sizeInBytes threshold reached, so wait a bit
|
||||
this.wait(pollInterval.toMillis());
|
||||
}
|
||||
@ -214,7 +214,7 @@ protected void doEnqueue(T record) throws InterruptedException {
|
||||
|
||||
if (queue.size() >= maxBatchSize || (maxQueueSizeInBytes > 0 && currentQueueSizeInBytes >= maxQueueSizeInBytes)) {
|
||||
// notify poll() to start draining queue and do not wait
|
||||
this.notify();
|
||||
this.notifyAll();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user