merlimat commented on code in PR #3544:
URL: https://github.com/apache/bookkeeper/pull/3544#discussion_r997695295


##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Journal.java:
##########
@@ -1080,7 +1083,19 @@ journalFormatVersionToWrite, getBufferedChannelBuilder(),
                             
.registerSuccessfulEvent(MathUtils.elapsedNanos(dequeueStartTime), 
TimeUnit.NANOSECONDS);
                     }
 
-                    if (numEntriesToFlush == 0) {
+                    if (localQueueEntries.isEmpty()) {
+                        queue.drainTo(localQueueEntries);
+                    }
+
+                    if (!localQueueEntries.isEmpty()) {

Review Comment:
   I'm not sure I got the scenario here. I think every time the loop goes back 
to the top on the `while (true)` and we should always check first the 
`localQueueEntries`  before attempting the `poll()`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to