mridulm commented on code in PR #49270:
URL: https://github.com/apache/spark/pull/49270#discussion_r1897189837
##########
core/src/main/scala/org/apache/spark/scheduler/TaskSchedulerImpl.scala:
##########
@@ -1212,6 +1212,16 @@ private[spark] class TaskSchedulerImpl(
override def applicationAttemptId(): Option[String] =
backend.applicationAttemptId()
+ override def hasRunningTasks(stageId: Int): Boolean = synchronized {
+ var hasRunningTasks = false
+ taskSetsByStageIdAndAttempt.get(stageId).foreach { attempts =>
+ attempts.foreach { case (_, tsm) =>
+ hasRunningTasks = hasRunningTasks || tsm.runningTasksSet.nonEmpty
+ }
+ }
+ hasRunningTasks
Review Comment:
Something like this would be better:
```suggestion
taskSetsByStageIdAndAttempt.get(stageId).exists{ attempts =>
attempts.values.exists(_.runningTasksSet.nonEmpty)
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]