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

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

Branch: refs/heads/branch-2.0
Commit: 7ee4aa459c4f35f35cfd86e45fa4f3787c1c9b0c
Parents: 2ab3ca0
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:31 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/7ee4aa45/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 05bb0d6..8f5535e 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
@@ -98,6 +98,9 @@ public class TableScanResource  extends ResourceBase {
                   kv.getTimestamp(), CellUtil.cloneValue(kv)));
             }
             count--;
+            if (count == 0) {
+              results.close();
+            }
             return rModel;
           }
         };