lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From no...@apache.org
Subject [34/50] [abbrv] lucene-solr:master: SOLR-10397: Break on interruption and always throw KeeperException on read otherwise trigger thread cannot function
Date Wed, 04 Oct 2017 08:25:26 GMT
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/master
Commit: bb408c35a13c9598e494e974486c601eb20b2d05
Parents: 61fe524
Author: Shalin Shekhar Mangar <shalin@apache.org>
Authored: Tue Sep 19 11:34:53 2017 -0700
Committer: Shalin Shekhar Mangar <shalin@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();


Mime
View raw message