cloud-fan commented on a change in pull request #23871:
[SPARK-23433][SPARK-25250] [CORE] Later created TaskSet should learn about the
finished partitions
URL: https://github.com/apache/spark/pull/23871#discussion_r260587589
##########
File path: core/src/main/scala/org/apache/spark/scheduler/TaskSetManager.scala
##########
@@ -189,6 +189,18 @@ private[spark] class TaskSetManager(
addPendingTask(i)
}
+ {
+ // TaskSet got submitted by DAGScheduler may have some already completed
+ // tasks since DAGScheduler does not always know all the tasks that have
+ // been completed by other tasksets when completing a stage, so we mark
+ // those tasks as finished here to avoid launching duplicate tasks, while
+ // holding the TaskSchedulerImpl lock.
+ // See SPARK-25250 and markPartitionCompletedInAllTaskSets()`
+ sched.stageIdToFinishedPartitions.get(taskSet.stageId).foreach {
+ finishedPartitions =>
finishedPartitions.foreach(markPartitionCompleted(_, None))
Review comment:
How do we guarantee that there is no race condition between the creation of
`TaskSetManager` and the updating of `TaskSchedulerImpl.
stageIdToFinishedPartitions`?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]