You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ap...@apache.org on 2018/08/07 20:33:12 UTC

[7/8] hbase git commit: HBASE-21007 Memory leak in HBase REST server

HBASE-21007 Memory leak in HBase REST server

Close the scanner leak in rest server when using the limit number of rows.

Example: when using uris like

        /sometable/*?limit=5&startrow=eGlND&endrow=eGlNE

where the scan range has more rows than the limit, the
rest server will start leaking memmory.

Signed-off-by: Andrew Purtell <ap...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/68981ee7
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/68981ee7
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/68981ee7

Branch: refs/heads/branch-1.3
Commit: 68981ee721fcdfc7c0d2d99c1a06c410c44d2465
Parents: 7b8ac04
Author: Bosko Devetak <bo...@gmail.com>
Authored: Tue Aug 7 13:54:00 2018 +0000
Committer: Andrew Purtell <ap...@apache.org>
Committed: Tue Aug 7 12:40:54 2018 -0700

----------------------------------------------------------------------
 .../main/java/org/apache/hadoop/hbase/rest/TableScanResource.java | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/68981ee7/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/TableScanResource.java
----------------------------------------------------------------------
diff --git a/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/TableScanResource.java b/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/TableScanResource.java
index 5cc2c7b..f2c5247 100644
--- a/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/TableScanResource.java
+++ b/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/TableScanResource.java
@@ -105,6 +105,9 @@ public class TableScanResource  extends ResourceBase {
                   kv.getTimestamp(), CellUtil.cloneValue(kv)));
             }
             count--;
+            if (count == 0) {
+              results.close();
+            }
             return rModel;
           }
         };