eolivelli commented on code in PR #4342:
URL: https://github.com/apache/bookkeeper/pull/4342#discussion_r1590802840


##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/zk/ZKMetadataDriverBase.java:
##########
@@ -212,6 +217,10 @@ protected void initialize(AbstractConfiguration<?> conf,
                     .sessionTimeoutMs(conf.getZkTimeout())
                     .operationRetryPolicy(zkRetryPolicy)
                     .requestRateLimit(conf.getZkRequestRateLimit())
+                    .watchers(Collections.singleton(watchedEvent -> {
+                        log.info("Got ZK session watch event: {}", 
watchedEvent);

Review Comment:
   This is probably adding noise, we should move this to "debug" level



##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/zk/ZKMetadataDriverBase.java:
##########
@@ -247,6 +256,19 @@ protected void initialize(AbstractConfiguration<?> conf,
             acls);
     }
 
+    private synchronized void handleState(Watcher.Event.KeeperState 
zkClientState) {

Review Comment:
   this is `synchronized` so we must add a 
   synchronized boolean isMetadataServiceAvailable()
   
   methodm otherwise we are not accessing the field properly



##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/zk/ZKMetadataDriverBase.java:
##########
@@ -247,6 +256,19 @@ protected void initialize(AbstractConfiguration<?> conf,
             acls);
     }
 
+    private synchronized void handleState(Watcher.Event.KeeperState 
zkClientState) {
+        switch (zkClientState) {
+            case Expired:
+            case Disconnected:
+                this.metadataServiceAvailable = false;
+                break;
+

Review Comment:
   nit: remove line break



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