Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 8D390200D23 for ; Wed, 4 Oct 2017 10:25:00 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 8C0DD160BE3; Wed, 4 Oct 2017 08:25:00 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id DAC25160BD7 for ; Wed, 4 Oct 2017 10:24:59 +0200 (CEST) Received: (qmail 54488 invoked by uid 500); 4 Oct 2017 08:24:57 -0000 Mailing-List: contact commits-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list commits@lucene.apache.org Received: (qmail 49811 invoked by uid 99); 4 Oct 2017 08:24:54 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Oct 2017 08:24:54 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 2E47BF5C45; Wed, 4 Oct 2017 08:24:54 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: noble@apache.org To: commits@lucene.apache.org Date: Wed, 04 Oct 2017 08:25:26 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [34/50] [abbrv] lucene-solr:master: SOLR-10397: Break on interruption and always throw KeeperException on read otherwise trigger thread cannot function archived-at: Wed, 04 Oct 2017 08:25:00 -0000 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 Authored: Tue Sep 19 11:34:53 2017 -0700 Committer: Shalin Shekhar Mangar 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();