Skip to content
Snippets Groups Projects
Commit 81b9d5b6 authored by Sandy Ryza's avatar Sandy Ryza Committed by Matei Zaharia
Browse files

SPARK-3052. Misleading and spurious FileSystem closed errors whenever a ...

...job fails while reading from Hadoop

Author: Sandy Ryza <sandy@cloudera.com>

Closes #1956 from sryza/sandy-spark-3052 and squashes the following commits:

815813a [Sandy Ryza] SPARK-3052. Misleading and spurious FileSystem closed errors whenever a job fails while reading from Hadoop
parent 066f31a6
No related branches found
No related tags found
No related merge requests found
......@@ -42,7 +42,8 @@ import org.apache.spark.broadcast.Broadcast
import org.apache.spark.deploy.SparkHadoopUtil
import org.apache.spark.executor.{DataReadMethod, InputMetrics}
import org.apache.spark.rdd.HadoopRDD.HadoopMapPartitionsWithSplitRDD
import org.apache.spark.util.NextIterator
import org.apache.spark.util.{NextIterator, Utils}
/**
* A Spark split class that wraps around a Hadoop InputSplit.
......@@ -228,7 +229,11 @@ class HadoopRDD[K, V](
try {
reader.close()
} catch {
case e: Exception => logWarning("Exception in RecordReader.close()", e)
case e: Exception => {
if (!Utils.inShutdown()) {
logWarning("Exception in RecordReader.close()", e)
}
}
}
}
}
......
......@@ -35,6 +35,7 @@ import org.apache.spark.SerializableWritable
import org.apache.spark.{SparkContext, TaskContext}
import org.apache.spark.executor.{DataReadMethod, InputMetrics}
import org.apache.spark.rdd.NewHadoopRDD.NewHadoopMapPartitionsWithSplitRDD
import org.apache.spark.util.Utils
private[spark] class NewHadoopPartition(
rddId: Int,
......@@ -153,7 +154,11 @@ class NewHadoopRDD[K, V](
try {
reader.close()
} catch {
case e: Exception => logWarning("Exception in RecordReader.close()", e)
case e: Exception => {
if (!Utils.inShutdown()) {
logWarning("Exception in RecordReader.close()", e)
}
}
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment