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


##########
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:
   If new entries keep put into the `queue`, the `localQueueEntries` won't be 
empty, it won't go into line#1107 branch, and the flush won't be triggered.



-- 
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