From fc9407f3a3d921a30a18664d1834018db4963e80 Mon Sep 17 00:00:00 2001 From: Zhihong Yu Date: Thu, 6 Mar 2014 01:42:32 +0000 Subject: [PATCH] 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 --- .../apache/hadoop/hbase/regionserver/HRegionServer.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java index 6191578ca4d..6b62c266908 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java @@ -3235,7 +3235,14 @@ public class HRegionServer implements ClientProtos.ClientService.BlockingInterfa return builder.build(); } catch (IOException ie) { 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); }