Github user vanzin commented on a diff in the pull request:
https://github.com/apache/spark/pull/6750#discussion_r33708206
--- Diff:
core/src/test/scala/org/apache/spark/scheduler/TaskSchedulerImplSuite.scala ---
@@ -128,4 +128,20 @@ class TaskSchedulerImplSuite extends SparkFunSuite
with LocalSparkContext with L
assert(taskDescriptions.map(_.executorId) === Seq("executor0"))
}
+ test("refuse to schedule concurrent attempts for the same stage
(SPARK-8103)") {
+ sc = new SparkContext("local", "TaskSchedulerImplSuite")
+ val taskScheduler = new TaskSchedulerImpl(sc)
+ taskScheduler.initialize(new FakeSchedulerBackend)
+ // Need to initialize a DAGScheduler for the taskScheduler to use for
callbacks.
+ val dagScheduler = new DAGScheduler(sc, taskScheduler) {
+ override def taskStarted(task: Task[_], taskInfo: TaskInfo) {}
+ override def executorAdded(execId: String, host: String) {}
+ }
+ taskScheduler.setDAGScheduler(dagScheduler)
+ 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)}
--- End diff --
nit: missing space before `}`
---
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]