hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
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 GMT
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();



Mime
View raw message