You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ma...@apache.org on 2012/05/07 17:35:50 UTC

svn commit: r1335067 - /lucene/dev/trunk/solr/core/src/java/org/apache/solr/cloud/ZkController.java

Author: markrmiller
Date: Mon May  7 15:35:50 2012
New Revision: 1335067

URL: http://svn.apache.org/viewvc?rev=1335067&view=rev
Log:
fix retry limit mismatch and print known config set names when config name cannot be found

Modified:
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/cloud/ZkController.java

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/cloud/ZkController.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/cloud/ZkController.java?rev=1335067&r1=1335066&r2=1335067&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/cloud/ZkController.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/cloud/ZkController.java Mon May  7 15:35:50 2012
@@ -924,15 +924,17 @@ public final class ZkController {
       InterruptedException {
     // check for configName
     log.info("Looking for collection configName");
+    List<String> configNames = null;
     int retry = 1;
-    for (; retry < 6; retry++) {
+    int retryLimt = 6;
+    for (; retry < retryLimt; retry++) {
       if (zkClient.exists(collectionPath, true)) {
         ZkNodeProps cProps = ZkNodeProps.load(zkClient.getData(collectionPath, null, null, true));
         if (cProps.containsKey(CONFIGNAME_PROP)) {
           break;
         }
       }
-      List<String> configNames = null;
+     
       // if there is only one conf, use that
       try {
         configNames = zkClient.getChildren(CONFIGS_ZKNODE, null,
@@ -949,11 +951,11 @@ public final class ZkController {
       log.info("Could not find collection configName - pausing for 3 seconds and trying again - try: " + retry);
       Thread.sleep(3000);
     }
-    if (retry == 10) {
+    if (retry == retryLimt) {
       log.error("Could not find configName for collection " + collection);
       throw new ZooKeeperException(
           SolrException.ErrorCode.SERVER_ERROR,
-          "Could not find configName for collection " + collection);
+          "Could not find configName for collection " + collection + " found:" + configNames);
     }
   }