Skip to content

Commit

Permalink
Revert "In sc.runJob, actually clean the inner closure"
Browse files Browse the repository at this point in the history
This reverts commit 3998168.
  • Loading branch information
Andrew Or committed Apr 29, 2015
1 parent 6f75784 commit 26c7aba
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions core/src/main/scala/org/apache/spark/SparkContext.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1627,10 +1627,7 @@ class SparkContext(config: SparkConf) extends Logging with ExecutorAllocationCli
partitions: Seq[Int],
allowLocal: Boolean
): Array[U] = {
// We must clean `func` here before using it in another closure below
// Otherwise, the closure cleaner will only clean the outer closure but not `func`
val cleanedFunc = clean(func)
runJob(rdd, (ctx: TaskContext, iter: Iterator[T]) => cleanedFunc(iter), partitions, allowLocal)
runJob(rdd, (context: TaskContext, iter: Iterator[T]) => func(iter), partitions, allowLocal)
}

/**
Expand Down

0 comments on commit 26c7aba

Please sign in to comment.