Skip to content

Commit 26c04a8

Browse files
committed
1
1 parent bf89f43 commit 26c04a8

File tree

1 file changed

+7
-1
lines changed
  • logstash-core/src/main/java/org/logstash/ackedqueue

1 file changed

+7
-1
lines changed

logstash-core/src/main/java/org/logstash/ackedqueue/Queue.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -753,16 +753,22 @@ public void ack(final long firstAckSeqNum, final int ackCount) throws IOExceptio
753753
// as a first implementation we assume that all batches are created from the same page
754754
lock.lock();
755755
try {
756+
boolean wasFull = isFull();
757+
756758
if (containsSeq(headPage, firstAckSeqNum)) {
757759
this.headPage.ack(firstAckSeqNum, ackCount, this.checkpointMaxAcks);
758760
} else {
759761
final int resultIndex = binaryFindPageForSeqnum(firstAckSeqNum);
760762
if (tailPages.get(resultIndex).ack(firstAckSeqNum, ackCount, this.checkpointMaxAcks)) {
761763
this.tailPages.remove(resultIndex);
762-
notFull.signalAll();
763764
}
764765
this.headPage.checkpoint();
765766
}
767+
768+
// If we were full before the ack and are not full anymore, signal that we might not be full
769+
if (wasFull && !isFull()) {
770+
notFull.signalAll();
771+
}
766772
} finally {
767773
lock.unlock();
768774
}

0 commit comments

Comments
 (0)