SOLR-12187: ZkStateReader.Notification thread should only catch Exception

This commit is contained in:
Cao Manh Dat 2018-04-18 08:40:06 +07:00
parent 8c60be4489
commit 1d2441441b
2 changed files with 8 additions and 6 deletions

View File

@ -28,6 +28,7 @@ import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Supplier;
import org.apache.solr.client.solrj.embedded.JettySolrRunner;
import org.apache.solr.client.solrj.request.CollectionAdminRequest;
@ -309,16 +310,17 @@ public class DeleteReplicaTest extends SolrCloudTestCase {
ZkContainer.testing_beforeRegisterInZk = null;
}
while (true) {
TimeOut timeOut = new TimeOut(30, TimeUnit.SECONDS, TimeSource.NANO_TIME);
timeOut.waitFor("Timeout adding replica to shard", () -> {
try {
CollectionAdminRequest.addReplicaToShard(collectionName, "shard1")
.process(cluster.getSolrClient());
break;
return true;
} catch (Exception e) {
// expected, when the node is not fully started
Thread.sleep(500);
return false;
}
}
});
waitForState("Expected 1x2 collections", collectionName, clusterShape(1, 2));
String leaderJettyNodeName = leaderJetty.getNodeName();

View File

@ -1626,8 +1626,8 @@ public class ZkStateReader implements Closeable {
if (watcher.onStateChanged(liveNodes, collectionState)) {
removeCollectionStateWatcher(collection, watcher);
}
} catch (Throwable throwable) {
LOG.warn("Error on calling watcher", throwable);
} catch (Exception exception) {
LOG.warn("Error on calling watcher", exception);
}
}
}