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:08 UTC
[3/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/ff89ec17
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/ff89ec17
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/ff89ec17
Branch: refs/heads/branch-2.1
Commit: ff89ec17c4f4be605cc9dd31fca18fd5ff2438cd
Parents: 9d594ac
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:24 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/ff89ec17/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;
}
};