Apache9 commented on code in PR #6987:
URL: https://github.com/apache/hbase/pull/6987#discussion_r2087019969


##########
hbase-zookeeper/src/main/java/org/apache/hadoop/hbase/zookeeper/RecoverableZooKeeper.java:
##########
@@ -726,6 +726,13 @@ public synchronized States getState() {
   }
 
   public synchronized ZooKeeper getZooKeeper() {

Review Comment:
   checkZk itself is synchronized, so we can remove the synchronized?



##########
hbase-zookeeper/src/main/java/org/apache/hadoop/hbase/zookeeper/RecoverableZooKeeper.java:
##########
@@ -726,6 +726,13 @@ public synchronized States getState() {
   }
 
   public synchronized ZooKeeper getZooKeeper() {
+    // Callers expect an initialized ZooKeeper instance
+    // Pre HBASE-28529 the constructor used to call checkZk()
+    try {
+      checkZk();
+    } catch (Exception x) {
+      // Just return null zk

Review Comment:
   Better log the exception and return null?



##########
hbase-zookeeper/src/main/java/org/apache/hadoop/hbase/zookeeper/RecoverableZooKeeper.java:
##########
@@ -726,6 +726,13 @@ public synchronized States getState() {
   }
 
   public synchronized ZooKeeper getZooKeeper() {
+    // Callers expect an initialized ZooKeeper instance
+    // Pre HBASE-28529 the constructor used to call checkZk()
+    try {
+      checkZk();

Review Comment:
   Just return checkZk?



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