Skip to content

Commit

Permalink
fix #SPARK-1149 Bad partitioners can cause Spark to hang
Browse files Browse the repository at this point in the history
  • Loading branch information
liguoqiang committed Feb 28, 2014
1 parent edf8a56 commit 6bb725e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/src/main/scala/org/apache/spark/SparkContext.scala
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,8 @@ class SparkContext(
partitions: Seq[Int],
allowLocal: Boolean,
resultHandler: (Int, U) => Unit) {
val rddPartitions = rdd.partitions.map(_.index)
partitions.foreach(p =>require(rddPartitions.contains(p), "partition index out of range: " +p))
val callSite = getCallSite
val cleanedFunc = clean(func)
logInfo("Starting job: " + callSite)
Expand Down

0 comments on commit 6bb725e

Please sign in to comment.