Shoothzj commented on a change in pull request #2819:
URL: https://github.com/apache/bookkeeper/pull/2819#discussion_r725736315



##########
File path: 
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/EntryLoggerAllocator.java
##########
@@ -182,6 +183,21 @@ private synchronized BufferedLogChannel 
allocateNewLog(File dirForNextEntryLog,
         return logChannel;
     }
 
+
+    private synchronized void closePreAllocateLog() {
+        if (preallocatedLogId != -1) {
+            // if preallocate new log success, release the file channel
+            try {
+                BufferedLogChannel bufferedLogChannel = 
getPreallocationFuture().get(3, TimeUnit.SECONDS);
+                if (bufferedLogChannel != null) {
+                    bufferedLogChannel.close();
+                }
+            } catch (IOException | InterruptedException | ExecutionException | 
TimeoutException e) {
+                log.warn("release preAllocator log failed, ignore error");

Review comment:
       Resolved




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