From a25ecd7f309f6476359408d59b607eea5f2f909e Mon Sep 17 00:00:00 2001 From: Andy Vuong Date: Fri, 22 Nov 2019 11:04:45 -0800 Subject: [PATCH] SOLR-13950: Fix getLeaderRetry swallowing interrupt in ZkStateReader (#1023) Let InterruptedException bubble up --- solr/CHANGES.txt | 2 ++ .../src/java/org/apache/solr/common/cloud/ZkStateReader.java | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index ed5ad19d976..9c3c34cb8af 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -111,6 +111,8 @@ Bug Fixes * SOLR-13941: Tests configure Jetty differently than when running via start.jar (janhoy, Uwe Schindler) +* SOLR-13950: Fix InterruptedException being swallowed in ZkStateReader’s getLeaderRetry method + Other Changes --------------------- diff --git a/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java b/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java index aad44067e4e..ad5682cf88e 100644 --- a/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java +++ b/solr/solrj/src/java/org/apache/solr/common/cloud/ZkStateReader.java @@ -970,7 +970,7 @@ public class ZkStateReader implements SolrCloseable { } return false; }); - } catch (TimeoutException | InterruptedException e) { + } catch (TimeoutException e) { throw new SolrException(ErrorCode.SERVICE_UNAVAILABLE, "No registered leader was found after waiting for " + timeout + "ms " + ", collection: " + collection + " slice: " + shard + " saw state=" + clusterState.getCollectionOrNull(collection) + " with live_nodes=" + clusterState.getLiveNodes());