SOLR-9291: ZkSolrResourceLoader should not retry fetching resources if the server has been shutdown

This commit is contained in:
Shalin Shekhar Mangar 2016-07-11 07:35:10 +05:30
parent 360b9a3528
commit 42e1caf2bf
3 changed files with 13 additions and 8 deletions

View File

@ -141,6 +141,9 @@ Bug Fixes
* SOLR-9236: AutoAddReplicas will append an extra /tlog to the update log location on replica failover.
(Eungsop Yoo, Mark Miller)
* SOLR-9291: ZkSolrResourceLoader should not retry fetching resources if the server has been shutdown.
(shalin)
Optimizations
----------------------

View File

@ -96,13 +96,15 @@ public class ZkSolrResourceLoader extends SolrResourceLoader {
}
} catch (KeeperException.SessionExpiredException e) {
exception = e;
// Retry in case of session expiry
try {
Thread.sleep(1000);
log.debug("Sleeping for 1s before retrying fetching resource=" + resource);
} catch (InterruptedException ie) {
Thread.currentThread().interrupt();
throw new IOException("Could not load resource=" + resource, ie);
if (!zkController.getCoreContainer().isShutDown()) {
// Retry in case of session expiry
try {
Thread.sleep(1000);
log.debug("Sleeping for 1s before retrying fetching resource=" + resource);
} catch (InterruptedException ie) {
Thread.currentThread().interrupt();
throw new IOException("Could not load resource=" + resource, ie);
}
}
} catch (InterruptedException e) {
Thread.currentThread().interrupt();

View File

@ -48,7 +48,7 @@ public class TestSolrConfigHandlerCloud extends AbstractFullDistribZkTestBase {
private void setupHarnesses() {
for (final SolrClient client : clients) {
RestTestHarness harness = new RestTestHarness(() -> ((HttpSolrClient)client).getBaseURL());
RestTestHarness harness = new RestTestHarness(((HttpSolrClient) client)::getBaseURL);
restTestHarnesses.add(harness);
}
}