Github user coolfrood commented on a diff in the pull request:
https://github.com/apache/spark/pull/6361#discussion_r31439444
--- Diff: core/src/main/scala/org/apache/spark/scheduler/Task.scala ---
@@ -126,6 +129,21 @@ private[spark] abstract class Task[T](val stageId:
Int, var partitionId: Int) ex
taskThread.interrupt()
}
}
+
+ /**
+ * Deserializes the task from the broadcast variable.
+ * If Kryo serialization is being sed, a copy of the buffer is made
because Kryo deserialization
+ * is not thread-safe w.r.t. the deserialization buffer (see SPARK-7708)
+ */
+ protected[this] def deserialize[T: ClassTag](taskBinary:
Broadcast[Array[Byte]]): T = {
+ val ser = SparkEnv.get.closureSerializer.newInstance()
--- End diff --
How do you feel about implementing a pool in the `Task` object and
accessing it from `Task`'s `run` method? This way, the serializer instance can
be handed back into the pool after the task is done executing.
---
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]