mirror of https://github.com/apache/lucene.git
SOLR-9291: ZkSolrResourceLoader should not retry fetching resources if the server has been shutdown
This commit is contained in:
parent
360b9a3528
commit
42e1caf2bf
|
@ -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
|
||||
----------------------
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue