You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ab...@apache.org on 2017/10/04 14:43:08 UTC
[12/45] lucene-solr:jira/solr-11285-sim: SOLR-10397: Break on
interruption and always throw KeeperException on read otherwise trigger
thread cannot function
SOLR-10397: Break on interruption and always throw KeeperException on read otherwise trigger thread cannot function
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/bb408c35
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/bb408c35
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/bb408c35
Branch: refs/heads/jira/solr-11285-sim
Commit: bb408c35a13c9598e494e974486c601eb20b2d05
Parents: 61fe524
Author: Shalin Shekhar Mangar <sh...@apache.org>
Authored: Tue Sep 19 11:34:53 2017 -0700
Committer: Shalin Shekhar Mangar <sh...@apache.org>
Committed: Tue Sep 19 11:34:53 2017 -0700
----------------------------------------------------------------------
.../solr/cloud/autoscaling/OverseerTriggerThread.java | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/bb408c35/solr/core/src/java/org/apache/solr/cloud/autoscaling/OverseerTriggerThread.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/cloud/autoscaling/OverseerTriggerThread.java b/solr/core/src/java/org/apache/solr/cloud/autoscaling/OverseerTriggerThread.java
index 1a1d341..34a6eaa 100644
--- a/solr/core/src/java/org/apache/solr/cloud/autoscaling/OverseerTriggerThread.java
+++ b/solr/core/src/java/org/apache/solr/cloud/autoscaling/OverseerTriggerThread.java
@@ -125,12 +125,13 @@ public class OverseerTriggerThread implements Runnable, Closeable {
// Restore the interrupted status
Thread.currentThread().interrupt();
log.warn("Interrupted", e);
+ break;
} catch (KeeperException e) {
log.error("A ZK error has occurred", e);
}
}
- if (!isClosed || Thread.currentThread().isInterrupted()) return;
+ if (isClosed || Thread.currentThread().isInterrupted()) return;
try {
refreshAutoScalingConf(new AutoScalingWatcher());
@@ -138,11 +139,7 @@ public class OverseerTriggerThread implements Runnable, Closeable {
log.warn("ZooKeeper watch triggered for autoscaling conf, but Solr cannot talk to ZK: [{}]", e.getMessage());
} catch (KeeperException e) {
log.error("A ZK error has occurred", e);
- if (!isClosed) {
- // throw exception only if we haven't been closed already
- throw new ZooKeeperException(SolrException.ErrorCode.SERVER_ERROR, "A ZK error has occurred", e);
- }
- return; // silently!
+ throw new ZooKeeperException(SolrException.ErrorCode.SERVER_ERROR, "A ZK error has occurred", e);
} catch (InterruptedException e) {
// Restore the interrupted status
Thread.currentThread().interrupt();