jayadeep-jayaraman commented on code in PR #50020: URL: https://github.com/apache/spark/pull/50020#discussion_r1992757166
########## core/src/main/scala/org/apache/spark/BarrierCoordinator.scala: ########## @@ -134,11 +138,8 @@ private[spark] class BarrierCoordinator( // Cancel the current active TimerTask and release resources. private def cancelTimerTask(): Unit = { - if (timerTask != null) { - timerTask.cancel() - timer.purge() - timerTask = null - } + timerFutures.asScala.foreach(_.cancel(false)) Review Comment: A new future will not come because when a stage is of type Barrier all the tasks are started together and the stage waits for all the tasks to complete before proceeding. Therefore, there will not be any future that will be added in between. Secondly, `cancelTimerTask` is called from within a `synchronized` block in the 2 places it is being called from -- 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: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org