Skip to content

Commit

Permalink
Fixes bufferlease reuse (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
StrongestNumber9 authored Oct 16, 2024
1 parent ba8d298 commit 5f0e4aa
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ public void run() {
boolean continueReading = true;
while (!activeBuffers.isEmpty()) {
BufferLease bufferLease = activeBuffers.removeFirst();
bufferLease.addRef();
LOGGER
.debug(
"submitting buffer <{}> from activeBuffers <{}> to relpFrame", bufferLease,
Expand All @@ -126,7 +127,7 @@ public void run() {
}

LOGGER.debug("clock returned continueReading <{}>", continueReading);
if (!bufferLease.isTerminated() && bufferLease.buffer().hasRemaining()) {
if (bufferLease.buffer().hasRemaining()) {
// return back as it has some remaining
LOGGER.debug("pushBack bufferLease id <{}>", bufferLease.id());
activeBuffers.push(bufferLease);
Expand All @@ -138,6 +139,7 @@ public void run() {
);
}
}
bufferLease.removeRef();
if (!continueReading) {
break;
}
Expand Down

0 comments on commit 5f0e4aa

Please sign in to comment.