Return-Path: X-Original-To: apmail-hive-commits-archive@www.apache.org Delivered-To: apmail-hive-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 D38A49E64 for ; Tue, 27 Nov 2012 17:34:47 +0000 (UTC) Received: (qmail 84456 invoked by uid 500); 27 Nov 2012 17:34:47 -0000 Delivered-To: apmail-hive-commits-archive@hive.apache.org Received: (qmail 84380 invoked by uid 500); 27 Nov 2012 17:34:47 -0000 Mailing-List: contact commits-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hive-dev@hive.apache.org Delivered-To: mailing list commits@hive.apache.org Received: (qmail 84369 invoked by uid 99); 27 Nov 2012 17:34:47 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Nov 2012 17:34:47 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Nov 2012 17:34:46 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 14947238899C; Tue, 27 Nov 2012 17:34:26 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1414279 - /hive/branches/branch-0.10/ql/src/java/org/apache/hadoop/hive/ql/Driver.java Date: Tue, 27 Nov 2012 17:34:25 -0000 To: commits@hive.apache.org From: hashutosh@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20121127173426.14947238899C@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: hashutosh Date: Tue Nov 27 17:34:24 2012 New Revision: 1414279 URL: http://svn.apache.org/viewvc?rev=1414279&view=rev Log: HIVE-3723 : Hive Driver leaks ZooKeeper connections (Gunther Hagleitner via Ashutosh Chauhan) Modified: hive/branches/branch-0.10/ql/src/java/org/apache/hadoop/hive/ql/Driver.java Modified: hive/branches/branch-0.10/ql/src/java/org/apache/hadoop/hive/ql/Driver.java URL: http://svn.apache.org/viewvc/hive/branches/branch-0.10/ql/src/java/org/apache/hadoop/hive/ql/Driver.java?rev=1414279&r1=1414278&r2=1414279&view=diff ============================================================================== --- hive/branches/branch-0.10/ql/src/java/org/apache/hadoop/hive/ql/Driver.java (original) +++ hive/branches/branch-0.10/ql/src/java/org/apache/hadoop/hive/ql/Driver.java Tue Nov 27 17:34:24 2012 @@ -845,20 +845,6 @@ public class Driver implements CommandPr } /** - * Release all the locks acquired implicitly by the statement. Note that the locks acquired with - * 'keepAlive' set to True are not released. - **/ - private void releaseLocks() { - if (ctx != null && ctx.getHiveLockMgr() != null) { - try { - ctx.getHiveLockMgr().close(); - ctx.setHiveLocks(null); - } catch (LockException e) { - } - } - } - - /** * @param hiveLocks * list of hive locks to be released Release all the locks specified. If some of the * locks have already been released, ignore them @@ -1488,7 +1474,18 @@ public class Driver implements CommandPr } public void destroy() { - releaseLocks(); + if (ctx != null) { + releaseLocks(ctx.getHiveLocks()); + } + + if (hiveLockMgr != null) { + try { + hiveLockMgr.close(); + } catch(LockException e) { + LOG.warn("Exception in closing hive lock manager. " + + org.apache.hadoop.util.StringUtils.stringifyException(e)); + } + } } public org.apache.hadoop.hive.ql.plan.api.Query getQueryPlan() throws IOException {