Github user JoshRosen commented on a diff in the pull request:
https://github.com/apache/spark/pull/4708#discussion_r25145446
--- Diff: core/src/main/scala/org/apache/spark/scheduler/DAGScheduler.scala
---
@@ -830,39 +836,39 @@ class DAGScheduler(
try {
// For ShuffleMapTask, serialize and broadcast (rdd, shuffleDep).
// For ResultTask, serialize and broadcast (rdd, func).
- val taskBinaryBytes: Array[Byte] =
- if (stage.isShuffleMap) {
- closureSerializer.serialize((stage.rdd, stage.shuffleDep.get) :
AnyRef).array()
- } else {
- closureSerializer.serialize((stage.rdd,
stage.resultOfJob.get.func) : AnyRef).array()
- }
+ val taskBinaryBytes: Array[Byte] = stage match {
+ case a: ShuffleMapStage =>
+ closureSerializer.serialize((a.rdd, a.shuffleDep):
AnyRef).array()
+ case b: ResultStage =>
+ closureSerializer.serialize((b.rdd, b.resultOfJob.get.func):
AnyRef).array()
+ }
+
taskBinary = sc.broadcast(taskBinaryBytes)
} catch {
// In the case of a failure during serialization, abort the stage.
case e: NotSerializableException =>
abortStage(stage, "Task not serializable: " + e.toString)
runningStages -= stage
- return
--- End diff --
I don't think that we can remove this `return` (or the one line 849). If
we remove this, then we'll hit errors later on because `taskBinary` will still
be null due to the serialization error.
I think we should add these return statements back and possibly add a
comment to each occurrence explaining why it's needed.
---
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]