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

(cherry picked from commit 42e1caf)
This commit is contained in:
Shalin Shekhar Mangar 2016-07-11 07:35:10 +05:30
parent da25555baf
commit 9d8cc80a79
3 changed files with 13 additions and 8 deletions

View File

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

View File

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

View File

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