Return-Path: X-Original-To: apmail-accumulo-commits-archive@www.apache.org Delivered-To: apmail-accumulo-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8F87617B6E for ; Thu, 6 Nov 2014 17:32:33 +0000 (UTC) Received: (qmail 26354 invoked by uid 500); 6 Nov 2014 17:32:33 -0000 Delivered-To: apmail-accumulo-commits-archive@accumulo.apache.org Received: (qmail 26214 invoked by uid 500); 6 Nov 2014 17:32:33 -0000 Mailing-List: contact commits-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list commits@accumulo.apache.org Received: (qmail 26169 invoked by uid 99); 6 Nov 2014 17:32:33 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Nov 2014 17:32:33 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 03CA68BC0E9; Thu, 6 Nov 2014 17:32:32 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: elserj@apache.org To: commits@accumulo.apache.org Date: Thu, 06 Nov 2014 17:32:32 -0000 Message-Id: <7c1fd9d9c966448184563f2c272fd184@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/3] git commit: ACCUMULO-3305 Use stopProcessWithTimeout instead of directly using Process API Repository: accumulo Updated Branches: refs/heads/1.6 b7b55eb64 -> cb262120e refs/heads/master 2f9340932 -> ce37a675f ACCUMULO-3305 Use stopProcessWithTimeout instead of directly using Process API We don't know if the start of a Process might be delayed, and, if we call destroy before this happens, then waitFor appears to hang indefinitely. Use the existing thread pool to guard against an inf loop. Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/cb262120 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/cb262120 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/cb262120 Branch: refs/heads/1.6 Commit: cb262120e8c11ea0afd5c08eb1124d9975941c8f Parents: b7b55eb Author: Josh Elser Authored: Thu Nov 6 12:17:18 2014 -0500 Committer: Josh Elser Committed: Thu Nov 6 12:17:18 2014 -0500 ---------------------------------------------------------------------- .../impl/MiniAccumuloClusterImpl.java | 38 +++++++++++++++----- 1 file changed, 29 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/cb262120/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java ---------------------------------------------------------------------- diff --git a/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java b/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java index 8216441..d45ef0f 100644 --- a/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java +++ b/minicluster/src/main/java/org/apache/accumulo/minicluster/impl/MiniAccumuloClusterImpl.java @@ -631,8 +631,13 @@ public class MiniAccumuloClusterImpl implements AccumuloCluster { switch (type) { case MASTER: if (proc.equals(masterProcess)) { - masterProcess.destroy(); - masterProcess.waitFor(); + try { + stopProcessWithTimeout(masterProcess, 30, TimeUnit.SECONDS); + } catch (ExecutionException e) { + log.warn("Master did not fully stop after 30 seconds", e); + } catch (TimeoutException e) { + log.warn("Master did not fully stop after 30 seconds", e); + } masterProcess = null; found = true; } @@ -642,8 +647,13 @@ public class MiniAccumuloClusterImpl implements AccumuloCluster { for (Process tserver : tabletServerProcesses) { if (proc.equals(tserver)) { tabletServerProcesses.remove(tserver); - tserver.destroy(); - tserver.waitFor(); + try { + stopProcessWithTimeout(tserver, 30, TimeUnit.SECONDS); + } catch (ExecutionException e) { + log.warn("TabletServer did not fully stop after 30 seconds", e); + } catch (TimeoutException e) { + log.warn("TabletServer did not fully stop after 30 seconds", e); + } found = true; break; } @@ -652,16 +662,26 @@ public class MiniAccumuloClusterImpl implements AccumuloCluster { break; case ZOOKEEPER: if (proc.equals(zooKeeperProcess)) { - zooKeeperProcess.destroy(); - zooKeeperProcess.waitFor(); + try { + stopProcessWithTimeout(zooKeeperProcess, 30, TimeUnit.SECONDS); + } catch (ExecutionException e) { + log.warn("ZooKeeper did not fully stop after 30 seconds", e); + } catch (TimeoutException e) { + log.warn("ZooKeeper did not fully stop after 30 seconds", e); + } zooKeeperProcess = null; found = true; } break; case GARBAGE_COLLECTOR: if (proc.equals(gcProcess)) { - gcProcess.destroy(); - gcProcess.waitFor(); + try { + stopProcessWithTimeout(gcProcess, 30, TimeUnit.SECONDS); + } catch (ExecutionException e) { + log.warn("GarbageCollector did not fully stop after 30 seconds", e); + } catch (TimeoutException e) { + log.warn("GarbageCollector did not fully stop after 30 seconds", e); + } gcProcess = null; found = true; } @@ -829,7 +849,7 @@ public class MiniAccumuloClusterImpl implements AccumuloCluster { /** * Get programmatic interface to information available in a normal monitor. XXX the returned structure won't contain information about the metadata table * until there is data in it. e.g. if you want to see the metadata table you should create a table. - * + * * @since 1.6.1 */ public MasterMonitorInfo getMasterMonitorInfo() throws AccumuloException, AccumuloSecurityException {