You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by te...@apache.org on 2011/08/22 23:09:29 UTC

svn commit: r1160437 - in /hbase/trunk: CHANGES.txt src/main/java/org/apache/hadoop/hbase/client/HTablePool.java

Author: tedyu
Date: Mon Aug 22 21:09:29 2011
New Revision: 1160437

URL: http://svn.apache.org/viewvc?rev=1160437&view=rev
Log:
HBASE-4167  Potential leak of HTable instances when using HTablePool with
               PoolType.ThreadLocal (Karthick Sankarachary)

Modified:
    hbase/trunk/CHANGES.txt
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HTablePool.java

Modified: hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/trunk/CHANGES.txt?rev=1160437&r1=1160436&r2=1160437&view=diff
==============================================================================
--- hbase/trunk/CHANGES.txt (original)
+++ hbase/trunk/CHANGES.txt Mon Aug 22 21:09:29 2011
@@ -206,6 +206,8 @@ Release 0.91.0 - Unreleased
    HBASE-4008  Problem while stopping HBase (Akash Ashok)
    HBASE-4065  TableOutputFormat ignores failure to create table instance
                (Brock Noland)
+   HBASE-4167  Potential leak of HTable instances when using HTablePool with
+               PoolType.ThreadLocal (Karthick Sankarachary)
 
   IMPROVEMENTS
    HBASE-3290  Max Compaction Size (Nicolas Spiegelberg via Stack)  

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HTablePool.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HTablePool.java?rev=1160437&r1=1160436&r2=1160437&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HTablePool.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HTablePool.java Mon Aug 22 21:09:29 2011
@@ -259,6 +259,7 @@ public class HTablePool implements Close
     String tableName = Bytes.toString(table.getTableName());
     if (tables.size(tableName) >= maxSize) {
       // release table instance since we're not reusing it
+      this.tables.remove(tableName, table);
       this.tableFactory.releaseHTableInterface(table);
       return;
     }
@@ -309,6 +310,7 @@ public class HTablePool implements Close
     for (String tableName : tables.keySet()) {
       closeTablePool(tableName);
     }
+    this.tables.clear();
   }
 
   int getCurrentPoolSize(String tableName) {