Explorar el Código

HDFS-6047 TestPread NPE inside in DFSInputStream hedgedFetchBlockByteRange (stack)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1574205 13f79535-47bb-0310-9956-ffa450edef68
Michael Stack hace 11 años
padre
commit
c0a903da22

+ 3 - 0
hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt

@@ -525,6 +525,9 @@ Release 2.4.0 - UNRELEASED
     HDFS-6040. fix DFSClient issue without libhadoop.so and some other
     ShortCircuitShm cleanups (cmccabe)
 
+    HDFS-6047 TestPread NPE inside in DFSInputStream hedgedFetchBlockByteRange
+    (stack)
+
   BREAKDOWN OF HDFS-5698 SUBTASKS AND RELATED JIRAS
 
     HDFS-5717. Save FSImage header in protobuf. (Haohui Mai via jing9)

+ 5 - 2
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSInputStream.java

@@ -1177,8 +1177,11 @@ implements ByteBufferReadable, CanSetDropBehind, CanSetReadahead,
           // exception already handled in the call method. getFirstToComplete
           // will remove the failing future from the list. nothing more to do.
         }
-        // We got here if exception.  Ignore this node on next go around.
-        ignored.add(chosenNode.info);
+        // We got here if exception.  Ignore this node on next go around IFF
+        // we found a chosenNode to hedge read against.
+        if (chosenNode != null && chosenNode.info != null) {
+          ignored.add(chosenNode.info);
+        }
       }
       // executed if we get an error from a data node
       block = getBlockAt(block.getStartOffset(), false);