Return-Path: X-Original-To: apmail-hbase-commits-archive@www.apache.org Delivered-To: apmail-hbase-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 47A077D62 for ; Tue, 27 Dec 2011 17:03:36 +0000 (UTC) Received: (qmail 56126 invoked by uid 500); 27 Dec 2011 17:03:36 -0000 Delivered-To: apmail-hbase-commits-archive@hbase.apache.org Received: (qmail 56078 invoked by uid 500); 27 Dec 2011 17:03:35 -0000 Mailing-List: contact commits-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list commits@hbase.apache.org Received: (qmail 56071 invoked by uid 99); 27 Dec 2011 17:03:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Dec 2011 17:03:35 +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 Dec 2011 17:03:34 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id C962023888D2 for ; Tue, 27 Dec 2011 17:03:13 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1224947 - in /hbase/branches/0.90: CHANGES.txt src/main/java/org/apache/hadoop/hbase/catalog/CatalogTracker.java Date: Tue, 27 Dec 2011 17:03:13 -0000 To: commits@hbase.apache.org From: tedyu@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20111227170313.C962023888D2@eris.apache.org> Author: tedyu Date: Tue Dec 27 17:03:13 2011 New Revision: 1224947 URL: http://svn.apache.org/viewvc?rev=1224947&view=rev Log: HBASE-5073 Registered listeners not getting removed leading to memory leak in HBaseAdmin (Ramkrishna) Modified: hbase/branches/0.90/CHANGES.txt hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/catalog/CatalogTracker.java Modified: hbase/branches/0.90/CHANGES.txt URL: http://svn.apache.org/viewvc/hbase/branches/0.90/CHANGES.txt?rev=1224947&r1=1224946&r2=1224947&view=diff ============================================================================== --- hbase/branches/0.90/CHANGES.txt (original) +++ hbase/branches/0.90/CHANGES.txt Tue Dec 27 17:03:13 2011 @@ -8,6 +8,8 @@ Release 0.90.6 - Unreleased HBASE-4893 HConnectionImplementation is closed but not deleted (Mubarak) HBASE-4970 Add a parameter so that keepAliveTime of Htable thread pool can be changed (gaojinchao) HBASE-5060 HBase client is blocked forever (Jinchao) + HBASE-5073 Registered listeners not getting removed leading to memory leak in HBaseAdmin + (Ramkrishna) Release 0.90.5 - Dec 22, 2011 BUG FIXES Modified: hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/catalog/CatalogTracker.java URL: http://svn.apache.org/viewvc/hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/catalog/CatalogTracker.java?rev=1224947&r1=1224946&r2=1224947&view=diff ============================================================================== --- hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/catalog/CatalogTracker.java (original) +++ hbase/branches/0.90/src/main/java/org/apache/hadoop/hbase/catalog/CatalogTracker.java Tue Dec 27 17:03:13 2011 @@ -75,6 +75,7 @@ public class CatalogTracker { private HServerAddress metaLocation; private final int defaultTimeout; private boolean stopped = false; + private boolean instantiatedzkw = false; private HConnection abortable; public static final byte [] ROOT_REGION = @@ -133,7 +134,15 @@ public class CatalogTracker { throws IOException { this.conf = conf; this.connection = connection; - this.zookeeper = (zk == null) ? this.connection.getZooKeeperWatcher() : zk; + if (zk == null) { + // Create our own. Set flag so we tear it down on stop. + this.zookeeper = + new ZooKeeperWatcher(conf, "catalogtracker-on-" + connection.toString(), + abortable); + instantiatedzkw = true; + } else { + this.zookeeper = zk; + } if (abortable == null) { this.abortable = this.connection; } @@ -190,6 +199,9 @@ public class CatalogTracker { // IOException}, in reality, the implementation would never do that. LOG.error("Attempt to close catalog tracker's connection failed.", e); } + if (this.instantiatedzkw) { + this.zookeeper.close(); + } // Call this and it will interrupt any ongoing waits on meta. synchronized (this.metaAvailable) { this.metaAvailable.notifyAll();