hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject git commit: HBASE-12274 Race between RegionScannerImpl#nextInternal() and RegionScannerImpl#close() may produce null pointer exception
Date Fri, 17 Oct 2014 16:04:14 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1 5b3f6fb1a -> be820f3b9


HBASE-12274 Race between RegionScannerImpl#nextInternal() and RegionScannerImpl#close() may
produce null pointer exception


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/be820f3b
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/be820f3b
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/be820f3b

Branch: refs/heads/branch-1
Commit: be820f3b9b8fc45a8bda745a3b1a4f4bf756c225
Parents: 5b3f6fb
Author: Ted Yu <tedyu@apache.org>
Authored: Fri Oct 17 16:04:02 2014 +0000
Committer: Ted Yu <tedyu@apache.org>
Committed: Fri Oct 17 16:04:02 2014 +0000

----------------------------------------------------------------------
 .../main/java/org/apache/hadoop/hbase/regionserver/HRegion.java | 4 ++++
 .../org/apache/hadoop/hbase/regionserver/RSRpcServices.java     | 5 ++++-
 2 files changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/be820f3b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
index e00b7fe..704e5c0 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
@@ -4113,6 +4113,10 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver
{ //
 
     @Override
     public boolean nextRaw(List<Cell> outResults, int limit) throws IOException {
+      if (storeHeap == null) {
+        // scanner is closed
+        throw new UnknownScannerException("Scanner was closed");
+      }
       boolean returnResult;
       if (outResults.isEmpty()) {
         // Usually outResults is empty. This is true when next is called

http://git-wip-us.apache.org/repos/asf/hbase/blob/be820f3b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
----------------------------------------------------------------------
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 a8f957e..ad75542 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
@@ -2137,9 +2137,12 @@ public class RSRpcServices implements HBaseRPCErrorHandler,
         if (rsh != null) {
           try {
             RegionScanner scanner = rsh.s;
+            LOG.warn(scannerName + " encountered " + ie.getMessage() + ", closing ...");
             scanner.close();
             regionServer.leases.cancelLease(scannerName);
-          } catch (IOException e) {}
+          } catch (IOException e) {
+           LOG.warn("Getting exception closing " + scannerName, e);
+          }
         }
       }
       throw new ServiceException(ie);


Mime
View raw message