Repository: hbase
Updated Branches:
  refs/heads/branch-2.0 6a081d347 -> 0d2b18bf2


HBASE-20350 NullPointerException in Scanner during close()


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

Branch: refs/heads/branch-2.0
Commit: 0d2b18bf2aef387506c6bfc97b17e7b6fd481981
Parents: 6a081d3
Author: Apekshit Sharma <a...@apache.org>
Authored: Fri Apr 6 20:24:45 2018 -0700
Committer: Michael Stack <st...@apache.org>
Committed: Wed Apr 11 14:34:02 2018 -0700

----------------------------------------------------------------------
 .../java/org/apache/hadoop/hbase/regionserver/KeyValueHeap.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/0d2b18bf/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/KeyValueHeap.java
----------------------------------------------------------------------
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/KeyValueHeap.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/KeyValueHeap.java
index 053ae99..b0f42d7 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/KeyValueHeap.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/KeyValueHeap.java
@@ -224,8 +224,8 @@ public class KeyValueHeap extends 
NonReversedNonLazyKeyValueScanner
       this.current.close();
     }
     if (this.heap != null) {
-      KeyValueScanner scanner;
-      while ((scanner = this.heap.poll()) != null) {
+      // Order of closing the scanners shouldn't matter here, so simply 
iterate and close them.
+      for (KeyValueScanner scanner : heap) {
         scanner.close();
       }
     }

Reply via email to