Github user squito commented on a diff in the pull request: https://github.com/apache/spark/pull/16620#discussion_r97586026 --- Diff: core/src/main/scala/org/apache/spark/scheduler/DAGScheduler.scala --- @@ -1193,7 +1193,14 @@ class DAGScheduler( } if (runningStages.contains(shuffleStage) && shuffleStage.pendingPartitions.isEmpty) { - markStageAsFinished(shuffleStage) + val noActiveTaskSetManager = + taskScheduler.rootPool == null || + !taskScheduler.rootPool.getSortedTaskSetQueue.exists { + tsm => tsm.stageId == stageId && !tsm.isZombie + } + if (shuffleStage.isAvailable || noActiveTaskSetManager) { + markStageAsFinished(shuffleStage) + } --- End diff -- I have to admit, though this passes all the tests, this is really confusing to me. I only somewhat understand why your original version didn't work, and why this should be used instead. Perhaps some more commenting here would help? The condition under which you do `markStageAsFinished` seems very broad, so perhaps its worth a comment on the case when you do *not* (and perhaps even a `logInfo` in an `else` branch). The discrepancy between pendingPartitions and availableOutputs is also surprising -- perhaps that is worth extra comments on `Stage`, on how the meaning of those two are different.
--- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org