You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/07/24 15:54:00 UTC

[GitHub] [spark] xuanyuanking commented on a change in pull request #25235: [WIP][SPARK-28483][Core] Fix canceling a spark job using barrier mode but barrier tasks do not exit

xuanyuanking commented on a change in pull request #25235: [WIP][SPARK-28483][Core] Fix canceling a spark job using barrier mode but barrier tasks do not exit
URL: https://github.com/apache/spark/pull/25235#discussion_r306880454
 
 

 ##########
 File path: core/src/main/scala/org/apache/spark/rpc/RpcEndpointRef.scala
 ##########
 @@ -92,4 +92,18 @@ private[spark] abstract class RpcEndpointRef(conf: SparkConf)
     timeout.awaitResult(future)
   }
 
+  def askSyncWithInterruptCheck[T: ClassTag](
+      message: Any,
+      timeout: RpcTimeout,
+      interruptCheck: () => Unit): T = {
+    val future = ask[T](message, timeout)
+    while(!future.isCompleted) {
+      interruptCheck()
+      Thread.sleep(10)
 
 Review comment:
   ~~Um, so there still has the possibility(very unlikely) if the tasks are killed during the 10ms?~~
   Ignore this.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org