jjayadeep06 commented on code in PR #50020:
URL: https://github.com/apache/spark/pull/50020#discussion_r1983092651


##########
core/src/main/scala/org/apache/spark/BarrierCoordinator.scala:
##########
@@ -80,8 +82,13 @@ private[spark] class BarrierCoordinator(
       states.forEachValue(1, clearStateConsumer)
       states.clear()
       listenerBus.removeListener(listener)
-      ThreadUtils.shutdown(timer)
     } finally {
+      timerFutures.asScala.foreach(_.cancel(true))
+      // Collections.synchronizedList should be synchronized for thread safety
+      timerFutures.synchronized {
+        timerFutures.clear()

Review Comment:
   Correct, removed it



##########
core/src/main/scala/org/apache/spark/BarrierCoordinator.scala:
##########
@@ -119,7 +126,9 @@ private[spark] class BarrierCoordinator(
     // A timer task that ensures we may timeout for a barrier() call.
     private var timerTask: TimerTask = null
 
-    // Init a TimerTask for a barrier() call.
+    /* Init a TimerTask for a barrier() call and also add logic to handle 
Thread Interruption

Review Comment:
   Updated the comment description



-- 
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

Reply via email to