Skip to content

Commit

Permalink
get rid of SparkIllegalStateException
Browse files Browse the repository at this point in the history
  • Loading branch information
squito committed Jul 7, 2015
1 parent b2faef5 commit 517b6e5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
10 changes: 0 additions & 10 deletions core/src/main/scala/org/apache/spark/SparkException.scala
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,3 @@ class SparkException(message: String, cause: Throwable)
*/
private[spark] class SparkDriverExecutionException(cause: Throwable)
extends SparkException("Execution error", cause)

/**
* Exception indicating an error internal to Spark -- it is in an inconsistent state, not due
* to any error by the user
*/
class SparkIllegalStateException(message: String, cause: Throwable)
extends SparkException(message, cause) {

def this(message: String) = this(message, null)
}
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ private[spark] class TaskSchedulerImpl(
ts.taskSet != taskSet && !ts.isZombie
}
if (conflictingTaskSet) {
throw new SparkIllegalStateException(s"more than one active taskSet for stage $stage:" +
throw new IllegalStateException(s"more than one active taskSet for stage $stage:" +
s" ${stageTaskSets.toSeq.map{_._2.taskSet.id}.mkString(",")}")
}
schedulableBuilder.addTaskSetManager(manager, manager.taskSet.properties)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,13 @@ class TaskSchedulerImplSuite extends SparkFunSuite with LocalSparkContext with L
val attempt1 = new TaskSet(Array(new FakeTask(0)), 0, 0, 0, null)
val attempt2 = new TaskSet(Array(new FakeTask(0)), 0, 1, 0, null)
taskScheduler.submitTasks(attempt1)
intercept[SparkIllegalStateException] { taskScheduler.submitTasks(attempt2) }
intercept[IllegalStateException] { taskScheduler.submitTasks(attempt2) }

// OK to submit multiple if previous attempts are all zombie
taskScheduler.activeTaskSets(attempt1.id).isZombie = true
taskScheduler.submitTasks(attempt2)
val attempt3 = new TaskSet(Array(new FakeTask(0)), 0, 2, 0, null)
intercept[SparkIllegalStateException] { taskScheduler.submitTasks(attempt3) }
intercept[IllegalStateException] { taskScheduler.submitTasks(attempt3) }
taskScheduler.activeTaskSets(attempt2.id).isZombie = true
taskScheduler.submitTasks(attempt3)
}
Expand Down

0 comments on commit 517b6e5

Please sign in to comment.