Skip to content

Commit 7db47c4

Browse files
techaddictpwendell
authored andcommitted
SPARK-1775: Unneeded lock in ShuffleMapTask.deserializeInfo
This was used in the past to have a cache of deserialized ShuffleMapTasks, but that's been removed, so there's no need for a lock. It slows down Spark when task descriptions are large, e.g. due to large lineage graphs or local variables. Author: Sandeep <[email protected]> Closes apache#707 from techaddict/SPARK-1775 and squashes the following commits: 18d8ebf [Sandeep] SPARK-1775: Unneeded lock in ShuffleMapTask.deserializeInfo This was used in the past to have a cache of deserialized ShuffleMapTasks, but that's been removed, so there's no need for a lock. It slows down Spark when task descriptions are large, e.g. due to large lineage graphs or local variables.
1 parent 06b15ba commit 7db47c4

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

core/src/main/scala/org/apache/spark/scheduler/ShuffleMapTask.scala

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,13 @@ private[spark] object ShuffleMapTask {
5757
}
5858

5959
def deserializeInfo(stageId: Int, bytes: Array[Byte]): (RDD[_], ShuffleDependency[_,_]) = {
60-
synchronized {
61-
val loader = Thread.currentThread.getContextClassLoader
62-
val in = new GZIPInputStream(new ByteArrayInputStream(bytes))
63-
val ser = SparkEnv.get.closureSerializer.newInstance()
64-
val objIn = ser.deserializeStream(in)
65-
val rdd = objIn.readObject().asInstanceOf[RDD[_]]
66-
val dep = objIn.readObject().asInstanceOf[ShuffleDependency[_,_]]
67-
(rdd, dep)
68-
}
60+
val loader = Thread.currentThread.getContextClassLoader
61+
val in = new GZIPInputStream(new ByteArrayInputStream(bytes))
62+
val ser = SparkEnv.get.closureSerializer.newInstance()
63+
val objIn = ser.deserializeStream(in)
64+
val rdd = objIn.readObject().asInstanceOf[RDD[_]]
65+
val dep = objIn.readObject().asInstanceOf[ShuffleDependency[_,_]]
66+
(rdd, dep)
6967
}
7068

7169
// Since both the JarSet and FileSet have the same format this is used for both.

0 commit comments

Comments
 (0)