Skip to content

Commit

Permalink
SPARK-3052. Misleading and spurious FileSystem closed errors whenever…
Browse files Browse the repository at this point in the history
… a ...

...job fails while reading from Hadoop

Author: Sandy Ryza <sandy@cloudera.com>

Closes apache#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
  • Loading branch information
sryza authored and mateiz committed Sep 2, 2014
1 parent 066f31a commit 81b9d5b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
9 changes: 7 additions & 2 deletions core/src/main/scala/org/apache/spark/rdd/HadoopRDD.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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)
}
}
}
}
}
Expand Down
7 changes: 6 additions & 1 deletion core/src/main/scala/org/apache/spark/rdd/NewHadoopRDD.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
}
}
}
}
}
Expand Down

0 comments on commit 81b9d5b

Please sign in to comment.