diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 7908b9ece2..acd5f15ae8 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/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) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSInputStream.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSInputStream.java index 5badb24b0a..3705a2fd4f 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSInputStream.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSInputStream.java @@ -1177,8 +1177,11 @@ private void hedgedFetchBlockByteRange(LocatedBlock block, long start, // 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);