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:13 UTC

[8/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/9d765cf9
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/9d765cf9
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/9d765cf9

Branch: refs/heads/branch-1.2
Commit: 9d765cf9fc426dbc2b6ba103f365a9bb9302fcff
Parents: ba0cc42
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:59 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/9d765cf9/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;
           }
         };