eolivelli commented on a change in pull request #2947:
URL: https://github.com/apache/bookkeeper/pull/2947#discussion_r783943968



##########
File path: 
bookkeeper-server/src/main/java/org/apache/bookkeeper/client/BookKeeper.java
##########
@@ -616,6 +617,23 @@ public void safeRun() {
 
     void checkForFaultyBookies() {
         List<BookieId> faultyBookies = bookieClient.getFaultyBookies();
+        if (faultyBookies.isEmpty()) {
+            return;
+        }
+
+        boolean isEnable = false;
+        try {
+            isEnable = metadataDriver.isHealthCheckEnabled().get();
+        } catch (InterruptedException e) {
+            LOG.error("isHealthCheckEnabled throw InterruptedException", e);

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

##########
File path: 
bookkeeper-server/src/main/java/org/apache/bookkeeper/client/BookKeeper.java
##########
@@ -616,6 +617,23 @@ public void safeRun() {
 
     void checkForFaultyBookies() {
         List<BookieId> faultyBookies = bookieClient.getFaultyBookies();
+        if (faultyBookies.isEmpty()) {
+            return;
+        }
+
+        boolean isEnable = false;
+        try {
+            isEnable = metadataDriver.isHealthCheckEnabled().get();
+        } catch (InterruptedException e) {
+            LOG.error("isHealthCheckEnabled throw InterruptedException", e);

Review comment:
       `LOG.error("Cannot verify if healthcheck is enabled", e);`

##########
File path: 
bookkeeper-server/src/main/java/org/apache/bookkeeper/client/BookKeeper.java
##########
@@ -616,6 +617,23 @@ public void safeRun() {
 
     void checkForFaultyBookies() {
         List<BookieId> faultyBookies = bookieClient.getFaultyBookies();
+        if (faultyBookies.isEmpty()) {
+            return;
+        }
+
+        boolean isEnable = false;
+        try {
+            isEnable = metadataDriver.isHealthCheckEnabled().get();
+        } catch (InterruptedException e) {
+            LOG.error("isHealthCheckEnabled throw InterruptedException", e);
+        } catch (ExecutionException e) {
+            LOG.error("isHealthCheckEnabled throw ExecutionException", e);

Review comment:
       `LOG.error("Cannot verify if healthcheck is enabled", e.getCause());`
   
   we can log "e.getCause()" because ExecutionException is always a wrapper for 
another problem




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