Skip to content

Commit c8a2313

Browse files
darabosaarondav
authored andcommitted
[SPARK-2403] Catch all errors during serialization in DAGScheduler
https://issues.apache.org/jira/browse/SPARK-2403 Spark hangs for us whenever we forget to register a class with Kryo. This should be a simple fix for that. But let me know if you have a better suggestion. I did not write a new test for this. It would be pretty complicated and I'm not sure it's worthwhile for such a simple change. Let me know if you disagree. Author: Daniel Darabos <[email protected]> Closes apache#1329 from darabos/spark-2403 and squashes the following commits: 3aceaad [Daniel Darabos] Print full stack trace for miscellaneous exceptions during serialization. 52c22ba [Daniel Darabos] Only catch NonFatal exceptions. 361e962 [Daniel Darabos] Catch all errors during serialization in DAGScheduler.
1 parent cc3e0a1 commit c8a2313

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

core/src/main/scala/org/apache/spark/scheduler/DAGScheduler.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import scala.concurrent.Await
2626
import scala.concurrent.duration._
2727
import scala.language.postfixOps
2828
import scala.reflect.ClassTag
29+
import scala.util.control.NonFatal
2930

3031
import akka.actor._
3132
import akka.actor.OneForOneStrategy
@@ -768,6 +769,10 @@ class DAGScheduler(
768769
abortStage(stage, "Task not serializable: " + e.toString)
769770
runningStages -= stage
770771
return
772+
case NonFatal(e) => // Other exceptions, such as IllegalArgumentException from Kryo.
773+
abortStage(stage, s"Task serialization failed: $e\n${e.getStackTraceString}")
774+
runningStages -= stage
775+
return
771776
}
772777

773778
logInfo("Submitting " + tasks.size + " missing tasks from " + stage + " (" + stage.rdd + ")")

0 commit comments

Comments
 (0)