dlg99 commented on a change in pull request #2802:
URL: https://github.com/apache/bookkeeper/pull/2802#discussion_r714363992



##########
File path: 
bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/Auditor.java
##########
@@ -1230,7 +1232,16 @@ void checkAllLedgers() throws BKException, IOException, 
InterruptedException, Ke
                     return;
                 }
 
+                try {
+                    semaphore.acquire();

Review comment:
       I'd consider using tryAcquire() with some reasonable timeout and either 
just treating the timeout similarly to `InterruptedException` (return) or retry 
in the loop. Plus add logging on the timeout.
   Otherwise one will have to deal with thread dumps to understand why auditor 
is not progressing when it is stuck on that semaphore in case of some obscure 
bug in zk client or server. 

##########
File path: 
bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/Auditor.java
##########
@@ -1230,7 +1232,16 @@ void checkAllLedgers() throws BKException, IOException, 
InterruptedException, Ke
                     return;
                 }
 
+                try {
+                    semaphore.acquire();
+                } catch (InterruptedException e) {
+                    LOG.error("Unable to acquire open ledger operation 
semaphore ", e);

Review comment:
       add `Thread.currentThread().interrupt();`




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