diff --git a/core/src/main/scala/org/apache/spark/storage/BlockFetcherIterator.scala b/core/src/main/scala/org/apache/spark/storage/BlockFetcherIterator.scala index 5f44f5f3197fd..5d98818a187fd 100644 --- a/core/src/main/scala/org/apache/spark/storage/BlockFetcherIterator.scala +++ b/core/src/main/scala/org/apache/spark/storage/BlockFetcherIterator.scala @@ -132,9 +132,12 @@ object BlockFetcherIterator { } case Failure(exception) => { logError("Could not get block(s) from " + cmId, exception) - for ((blockId, size) <- req.blocks) { - results.put(new FetchResult(blockId, -1, null)) - } + /** + * In current implementation, only pass the first element is enough + * because when iterator get FetchResult which size is -1, + * FetchFailedException is thrown immediately. + */ + results.put(new FetchResult(req.blocks(0)._1, -1, null)) } } }