Skip to content

Commit dfd40e9

Browse files
committed
Merge pull request #175 from kayousterhout/no_retry_not_serializable
Don't retry tasks when they fail due to a NotSerializableException As with my previous pull request, this will be unit tested once the Cluster and Local schedulers get merged.
2 parents ed25105 + 29c88e4 commit dfd40e9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

core/src/main/scala/org/apache/spark/scheduler/cluster/ClusterTaskSetManager.scala

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
package org.apache.spark.scheduler.cluster
1919

20+
import java.io.NotSerializableException
2021
import java.util.Arrays
2122

2223
import scala.collection.mutable.ArrayBuffer
@@ -484,6 +485,14 @@ private[spark] class ClusterTaskSetManager(
484485

485486
case ef: ExceptionFailure =>
486487
sched.dagScheduler.taskEnded(tasks(index), ef, null, null, info, ef.metrics.getOrElse(null))
488+
if (ef.className == classOf[NotSerializableException].getName()) {
489+
// If the task result wasn't serializable, there's no point in trying to re-execute it.
490+
logError("Task %s:%s had a not serializable result: %s; not retrying".format(
491+
taskSet.id, index, ef.description))
492+
abort("Task %s:%s had a not serializable result: %s".format(
493+
taskSet.id, index, ef.description))
494+
return
495+
}
487496
val key = ef.description
488497
val now = clock.getTime()
489498
val (printFull, dupCount) = {

0 commit comments

Comments
 (0)