You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by pa...@apache.org on 2022/04/15 06:11:15 UTC
[hbase] branch branch-2.5 updated: HBASE-26944 Possible resource leak while creating new region scanner (#4339)
This is an automated email from the ASF dual-hosted git repository.
pankajkumar pushed a commit to branch branch-2.5
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/branch-2.5 by this push:
new 3510db4d2d HBASE-26944 Possible resource leak while creating new region scanner (#4339)
3510db4d2d is described below
commit 3510db4d2d40a95f2b7e31443e190a6174e1998c
Author: Pankaj <pa...@apache.org>
AuthorDate: Fri Apr 15 11:34:25 2022 +0530
HBASE-26944 Possible resource leak while creating new region scanner (#4339)
* HBASE-26944 Possible resource leak while creating new region scanner
Signed-off-by: Duo Zhang <zh...@apache.org>
(cherry picked from commit 62e3efccef766e580642a8b7cb5654c96e47687d)
---
.../org/apache/hadoop/hbase/regionserver/RSRpcServices.java | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
index b6190f0374..53ce61eb3f 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
@@ -3233,8 +3233,16 @@ public class RSRpcServices implements HBaseRPCErrorHandler,
RegionScannerImpl coreScanner = region.getScanner(scan);
Shipper shipper = coreScanner;
RegionScanner scanner = coreScanner;
- if (region.getCoprocessorHost() != null) {
- scanner = region.getCoprocessorHost().postScannerOpen(scan, scanner);
+ try {
+ if (region.getCoprocessorHost() != null) {
+ scanner = region.getCoprocessorHost().postScannerOpen(scan, scanner);
+ }
+ } catch (Exception e) {
+ // Although region coprocessor is for advanced users and they should take care of the
+ // implementation to not damage the HBase system, closing the scanner on exception here does
+ // not have any bad side effect, so let's do it
+ scanner.close();
+ throw e;
}
long scannerId = scannerIdGenerator.generateNewScannerId();
builder.setScannerId(scannerId);