Github user markhamstra commented on a diff in the pull request:
https://github.com/apache/spark/pull/6750#discussion_r33724583
--- Diff:
core/src/main/scala/org/apache/spark/scheduler/TaskSchedulerImpl.scala ---
@@ -163,6 +163,15 @@ private[spark] class TaskSchedulerImpl(
this.synchronized {
val manager = createTaskSetManager(taskSet, maxTaskFailures)
activeTaskSets(taskSet.id) = manager
+ val stage = taskSet.stageId
+ val conflictingTaskSet = activeTaskSets.exists { case (id, ts) =>
+ // if the id matches, it really should be the same taskSet, but in
some unit tests
+ // we add new taskSets with the same id
+ id != taskSet.id && !ts.isZombie && ts.stageId == stage
+ }
+ if (conflictingTaskSet) {
+ throw new SparkIllegalStateException(s"more than one active
taskSet for stage $stage")
+ }
--- End diff --
Yes, I totally agree that it is valuable to catch the failure in
production. I'm only suggesting that at some point the check becomes a big
enough performance hit that it makes sense to compromise on the fail-fast
desiderata in order to maintain production performance while trying to ensure
in development that the failure can never occur. I doubt that this check is
that costly, but my expectation is that Kay has a better sense of how much more
we can afford to do within this synchronized block.
---
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]