You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2022/08/05 14:30:34 UTC

[GitHub] [accumulo] ctubbsii commented on a diff in pull request #2848: Added more debug information, retry ZK dump when not connected

ctubbsii commented on code in PR #2848:
URL: https://github.com/apache/accumulo/pull/2848#discussion_r938876712


##########
minicluster/src/main/java/org/apache/accumulo/miniclusterImpl/MiniAccumuloClusterImpl.java:
##########
@@ -666,27 +666,34 @@ private void verifyUp() throws InterruptedException, IOException {
             instanceId = new String(bytes, UTF_8);
             break;
           } catch (KeeperException e) {
+            log.warn("Error trying to read instance id from zookeeper: " + e.getMessage());
             log.debug("Unable to read instance id from zookeeper.", e);
           }
         }
         Thread.sleep(1000);
       }
 
       if (instanceId == null) {
-        try {
-          log.warn("******* COULD NOT FIND INSTANCE ID - DUMPING ZK ************");
-          log.warn("Connected to ZooKeeper: {}", getZooKeepers());
-          log.warn("Looking for instanceId at {}",
-              Constants.ZROOT + Constants.ZINSTANCES + "/" + config.getInstanceName());
-          ZKUtil.visitSubTreeDFS(zk, Constants.ZROOT, false, new StringCallback() {
-            @Override
-            public void processResult(int rc, String path, Object ctx, String name) {
-              log.warn("{}", path);
+        for (int i = 0; i < numTries; i++) {
+          if (zk.getState().equals(States.CONNECTED)) {

Review Comment:
   When comparing equality with enums, you should always use `==`, not `.equals` so you get compile-time type safety. I'll submit a follow-up commit a fix to this, since it's already merged.



-- 
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: notifications-unsubscribe@accumulo.apache.org

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