HBASE-10662 RegionScanner is never closed if the region has been moved-out or re-opened when performing scan request

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1574743 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Zhihong Yu 2014-03-06 01:42:32 +00:00
parent 78b7dad2c8
commit fc9407f3a3
1 changed files with 8 additions and 1 deletions

View File

@ -3235,7 +3235,14 @@ public class HRegionServer implements ClientProtos.ClientService.BlockingInterfa
return builder.build(); return builder.build();
} catch (IOException ie) { } catch (IOException ie) {
if (scannerName != null && ie instanceof NotServingRegionException) { if (scannerName != null && ie instanceof NotServingRegionException) {
scanners.remove(scannerName); RegionScannerHolder rsh = scanners.remove(scannerName);
if (rsh != null) {
try {
RegionScanner scanner = rsh.s;
scanner.close();
leases.cancelLease(scannerName);
} catch (IOException e) {}
}
} }
throw new ServiceException(ie); throw new ServiceException(ie);
} }