Return-Path: X-Original-To: apmail-tez-commits-archive@minotaur.apache.org Delivered-To: apmail-tez-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 93F271777E for ; Thu, 23 Apr 2015 19:17:43 +0000 (UTC) Received: (qmail 58707 invoked by uid 500); 23 Apr 2015 19:17:43 -0000 Delivered-To: apmail-tez-commits-archive@tez.apache.org Received: (qmail 58673 invoked by uid 500); 23 Apr 2015 19:17:43 -0000 Mailing-List: contact commits-help@tez.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tez.apache.org Delivered-To: mailing list commits@tez.apache.org Received: (qmail 58664 invoked by uid 99); 23 Apr 2015 19:17:43 -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; Thu, 23 Apr 2015 19:17:43 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id E18E0E051A; Thu, 23 Apr 2015 19:17:42 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: prakash@apache.org To: commits@tez.apache.org Message-Id: <8817141a293b47229c8381af82c92589@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: tez git commit: TEZ-1969. Stop the DAGAppMaster when a local mode client is stopped (pramachandran) Date: Thu, 23 Apr 2015 19:17:42 +0000 (UTC) Repository: tez Updated Branches: refs/heads/branch-0.6 e4e51858b -> 26a8dcbd6 TEZ-1969. Stop the DAGAppMaster when a local mode client is stopped (pramachandran) (cherry picked from commit 3e6fc355c618b77531f7d29b6a1c9cbc3c39456a) Project: http://git-wip-us.apache.org/repos/asf/tez/repo Commit: http://git-wip-us.apache.org/repos/asf/tez/commit/26a8dcbd Tree: http://git-wip-us.apache.org/repos/asf/tez/tree/26a8dcbd Diff: http://git-wip-us.apache.org/repos/asf/tez/diff/26a8dcbd Branch: refs/heads/branch-0.6 Commit: 26a8dcbd637b47aa372a531e329ad4aac4b27048 Parents: e4e5185 Author: Prakash Ramachandran Authored: Fri Apr 17 07:54:43 2015 +0530 Committer: Prakash Ramachandran Committed: Fri Apr 24 00:06:13 2015 +0530 ---------------------------------------------------------------------- CHANGES.txt | 1 + .../main/java/org/apache/tez/client/LocalClient.java | 14 +++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tez/blob/26a8dcbd/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index 573ebaf..a8d9f83 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -6,6 +6,7 @@ Release 0.6.1: Unreleased INCOMPATIBLE CHANGES ALL CHANGES: + TEZ-1969. Stop the DAGAppMaster when a local mode client is stopped TEZ-2329. UI Query on final dag status performance improvement TEZ-2287. Deprecate VertexManagerPluginContext.getTaskContainer(). TEZ-1909. Remove need to copy over all events from attempt 1 to attempt 2 dir http://git-wip-us.apache.org/repos/asf/tez/blob/26a8dcbd/tez-dag/src/main/java/org/apache/tez/client/LocalClient.java ---------------------------------------------------------------------- diff --git a/tez-dag/src/main/java/org/apache/tez/client/LocalClient.java b/tez-dag/src/main/java/org/apache/tez/client/LocalClient.java index bb39e13..2f8da9c 100644 --- a/tez-dag/src/main/java/org/apache/tez/client/LocalClient.java +++ b/tez-dag/src/main/java/org/apache/tez/client/LocalClient.java @@ -106,6 +106,14 @@ public class LocalClient extends FrameworkClient { public void close() throws IOException { // LocalClients are shared between TezClient and DAGClients, which can cause stop / start / close // to be invoked multiple times. If modifying these methods - this should be factored in. + + // Multiple DAGClient's can reuse the LocalClient (for ex session). However there is only a + // single instance of LocalClient for a TezClient, and dagAppMaster can be cleaned up when + // the TezClient is stopped, in order not to leak. + if (dagAppMaster != null) { + dagAppMaster.stop(); + dagAppMaster = null; + } } @Override @@ -302,8 +310,12 @@ public class LocalClient extends FrameworkClient { clientHandler = new DAGClientHandler(dagAppMaster); DAGAppMaster.initAndStartAppMaster(dagAppMaster, currentUser.getShortUserName()); - } catch (Throwable t) { + } catch (Throwable t) { LOG.fatal("Error starting DAGAppMaster", t); + if (dagAppMaster != null) { + dagAppMaster.stop(); + dagAppMaster = null; + } System.exit(1); } }