Github user andrewor14 commented on a diff in the pull request:
https://github.com/apache/spark/pull/3638#discussion_r22693927
--- Diff:
core/src/main/scala/org/apache/spark/scheduler/TaskSetManager.scala ---
@@ -456,10 +459,18 @@ private[spark] class TaskSetManager(
}
// Serialize and return the task
val startTime = clock.getTime()
- // We rely on the DAGScheduler to catch non-serializable
closures and RDDs, so in here
- // we assume the task can be serialized without exceptions.
- val serializedTask = Task.serializeWithDependencies(
- task, sched.sc.addedFiles, sched.sc.addedJars, ser)
+ val serializedTask: ByteBuffer = try {
+ Task.serializeWithDependencies(task, sched.sc.addedFiles,
+ sched.sc.addedJars, ser)
+ } catch {
+ // If the task cannot be serialized, then there's no point to
re-attempt the task,
+ // as it will always fail. So just abort the whole task-set.
+ case NonFatal(e) =>
+ logError(s"Failed to serialize task $taskId, not attempting
to retry it.", e)
+ abort(s"Failed to serialize task $taskId, not attempt to
retry it. Exception " +
+ s"during serialization is: $e")
--- End diff --
Looks like there's some duplication here. Can you put this in a val:
```
val msg = s"Failed to serialize task $taskId, not attempting to retry it."
logError(msg, e)
abort(s"$msg Exception during serialization: $e")
```
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]