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,6 +96,7 @@ public class ZkSolrResourceLoader extends SolrResourceLoader {
}
} catch (KeeperException.SessionExpiredException e) {
exception = e;
if (!zkController.getCoreContainer().isShutDown()) {
// Retry in case of session expiry
try {
Thread.sleep(1000);
@ -104,6 +105,7 @@ public class ZkSolrResourceLoader extends SolrResourceLoader {
Thread.currentThread().interrupt();
throw new IOException("Could not load resource=" + resource, ie);
}
}
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new IOException("Error opening " + file, e);

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);
}
}