Github user mccheah commented on a diff in the pull request:
https://github.com/apache/spark/pull/3638#discussion_r22695144
--- Diff: core/src/main/scala/org/apache/spark/scheduler/DAGScheduler.scala
---
@@ -865,26 +865,6 @@ class DAGScheduler(
}
if (tasks.size > 0) {
- // Preemptively serialize a task to make sure it can be serialized.
We are catching this
- // exception here because it would be fairly hard to catch the
non-serializable exception
- // down the road, where we have several different implementations
for local scheduler and
- // cluster schedulers.
- //
- // We've already serialized RDDs and closures in taskBinary, but
here we check for all other
- // objects such as Partition.
- try {
- closureSerializer.serialize(tasks.head)
- } catch {
- case e: NotSerializableException =>
- abortStage(stage, "Task not serializable: " + e.toString)
- runningStages -= stage
- return
- case NonFatal(e) => // Other exceptions, such as
IllegalArgumentException from Kryo.
- abortStage(stage, s"Task serialization failed:
$e\n${e.getStackTraceString}")
- runningStages -= stage
- return
- }
-
--- End diff --
This is the main addition in the patch - to make it so that task
serialization error handling is only done when the serialization actually
occurs.
It turns out there are many scenarios where this selective sampling does
not actually work. For example, when you create an RDD from an in-memory
collection, perhaps some of the items are serializable but others are not. E.g.
consider a list of containers, where the first item in the list is an empty
container, and the second item in the list is a non-empty container with
non-serializable things.
---
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]