lordcheng10 commented on a change in pull request #2947:
URL: https://github.com/apache/bookkeeper/pull/2947#discussion_r783773417
##########
File path:
bookkeeper-server/src/main/java/org/apache/bookkeeper/client/BookKeeper.java
##########
@@ -606,16 +607,26 @@ void
scheduleBookieHealthCheckIfEnabled(ClientConfiguration conf) {
scheduler.scheduleAtFixedRate(new SafeRunnable() {
@Override
- public void safeRun() {
+ public void safeRun() throws ExecutionException,
InterruptedException {
checkForFaultyBookies();
}
}, conf.getBookieHealthCheckIntervalSeconds(),
conf.getBookieHealthCheckIntervalSeconds(),
TimeUnit.SECONDS);
}
}
- void checkForFaultyBookies() {
+ void checkForFaultyBookies() throws ExecutionException,
InterruptedException {
List<BookieId> faultyBookies = bookieClient.getFaultyBookies();
+ if (faultyBookies.isEmpty()) {
+ return;
+ }
+
+ boolean isEnable = metadataDriver.isHealthCheckEnabled().get();
Review comment:
like this?
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);
}
if (!isEnable) {
LOG.info("Health checks is currently disabled!");
return;
}
--
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]