Apache9 commented on code in PR #6768:
URL: https://github.com/apache/hbase/pull/6768#discussion_r2039570569
##########
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java:
##########
@@ -3191,9 +3192,20 @@ private RegionScannerImpl getScanner(Scan scan,
List<KeyValueScanner> additional
checkFamily(family);
}
}
- return instantiateRegionScanner(scan, additionalScanners, nonceGroup,
nonce);
+
+ regionScanner = instantiateRegionScanner(scan, additionalScanners,
nonceGroup, nonce);
+ return regionScanner;
} finally {
- closeRegionOperation(Operation.SCAN);
+ // close region operation can throw an exception, in that case the
scanner never gets
+ // closed.
+ try {
+ closeRegionOperation(Operation.SCAN);
+ } catch (Throwable t) {
Review Comment:
Do we really need to catch Throwable? Usually catch Exception is enough...
##########
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java:
##########
@@ -3175,31 +3175,42 @@ private Pair<String, RegionScannerHolder>
newRegionScanner(ScanRequest request,
// wrapper for the core created RegionScanner
region.getCoprocessorHost().preScannerOpen(scan);
}
- RegionScannerImpl coreScanner = region.getScanner(scan);
- Shipper shipper = coreScanner;
- RegionScanner scanner = coreScanner;
+ RegionScanner scanner = null;
try {
- if (region.getCoprocessorHost() != null) {
- scanner = region.getCoprocessorHost().postScannerOpen(scan, scanner);
+ RegionScannerImpl coreScanner = region.getScanner(scan);
Review Comment:
I think the intention here is that, if region.getScanner throws exception,
there is no way for us to get the reference of the RegionScannerImpl, so just
need to throw the exception out, without closing the scanner as we do not have
its reference.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]