You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2021/09/22 22:56:54 UTC

[GitHub] [bookkeeper] dlg99 commented on a change in pull request #2802: Add auditor get ledger throttle to avoid auto recovery zk session expire

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: issues-unsubscribe@bookkeeper.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org