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:05:50 GMT
Repository: hbase
Updated Branches:
  refs/heads/master 7c87f9c6b -> 686e77108


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/686e7710
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/686e7710
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/686e7710

Branch: refs/heads/master
Commit: 686e77108a339516e4a78751fc4982072e171e97
Parents: 7c87f9c
Author: Ted Yu <tedyu@apache.org>
Authored: Fri Oct 17 16:05:31 2014 +0000
Committer: Ted Yu <tedyu@apache.org>
Committed: Fri Oct 17 16:05:31 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/686e7710/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 28c6cc5..67ff2cb 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
@@ -4108,6 +4108,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/686e7710/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 eae6e96..dc4bf7b 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
@@ -2164,9 +2164,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