Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-4421,SOLR-4165: Fix wait loop to sleep, reduce max wait time, wait min 1 second

Mark Robert Millerd540b8e1223a
diff --git a/solr/core/src/java/org/apache/solr/cloud/ZkController.java b/solr/core/src/java/org/apache/solr/cloud/ZkController.java
index f6ae41951f6..8a0cc487c6b 100644
--- a/solr/core/src/java/org/apache/solr/cloud/ZkController.java
+++ b/solr/core/src/java/org/apache/solr/cloud/ZkController.java
@@ -564,7 +564,7 @@ public final class ZkController {
// now wait till the updates are in our state
long now = System.currentTimeMillis();
- long timeout = now + 1000 * 300;
+ long timeout = now + 1000 * 30;
boolean foundStates = false;
while (System.currentTimeMillis() < timeout) {
clusterState = zkStateReader.getClusterState();
@@ -586,8 +586,10 @@ public final class ZkController {
if (updatedNodes.size() == 0) {
foundStates = true;
+ Thread.sleep(1000);
break;
}
+ Thread.sleep(1000);
}
if (!foundStates) {
log.warn("Timed out waiting to see all nodes published as DOWN in our cluster state.");