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 <zhangduo@apache.org> (cherry picked from commit 62e3efccef766e580642a8b7cb5654c96e47687d)
This commit is contained in:
parent
1fc186643f
commit
eea9e78d17
@ -3202,8 +3202,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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user