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:08:25 GMT
Repository: hbase
Updated Branches:
  refs/heads/0.98 82fb65819 -> 776a0b09a


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

Branch: refs/heads/0.98
Commit: 776a0b09a2bde71210033a77ff56af5d73534f7e
Parents: 82fb658
Author: Ted Yu <tedyu@apache.org>
Authored: Fri Oct 17 16:08:15 2014 +0000
Committer: Ted Yu <tedyu@apache.org>
Committed: Fri Oct 17 16:08:15 2014 +0000

----------------------------------------------------------------------
 .../java/org/apache/hadoop/hbase/regionserver/HRegion.java     | 6 +++++-
 .../org/apache/hadoop/hbase/regionserver/HRegionServer.java    | 5 ++++-
 2 files changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/776a0b09/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 313baca..37accdf 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
@@ -3937,7 +3937,11 @@ public class HRegion implements HeapSize { // , Writable{
     }
 
     @Override
-    public boolean nextRaw(List<Cell> outResults, int limit) throws IOException {
+    public synchronized 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/776a0b09/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
----------------------------------------------------------------------
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 ff86b00..9fcc14c 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
@@ -3317,9 +3317,12 @@ public class HRegionServer implements ClientProtos.ClientService.BlockingInterfa
         if (rsh != null) {
           try {
             RegionScanner scanner = rsh.s;
+            LOG.warn(scannerName + " encountered " + ie.getMessage() + ", closing ...");
             scanner.close();
             leases.cancelLease(scannerName);
-          } catch (IOException e) {}
+          } catch (IOException e) {
+            LOG.warn("Getting exception closing " + scannerName, e);
+          }
         }
       }
       throw new ServiceException(ie);


Mime
View raw message