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 07:49:03 UTC

[GitHub] [spark] WeichenXu123 commented on issue #25235: [WIP][SPARK-28483][Core] Fix canceling a spark job using barrier mode but barrier tasks do not exit

WeichenXu123 commented on issue #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#issuecomment-514520895
 
 
   The reason I do not use `thread.interrupt` to cancel the thread is:
   * In spark framework, when `Task.kill(interruptThread: Boolean, reason: String)` being called, the `interruptThread` flag is sometimes `false` which do not allow us to interrupt the task thread.
   * Even we can interrupt the task thread, the scala `Future` do not support `thread.interrupt`, i.e. the `Future.await` will still block until timeout and ignore the interrupt signal.
   
   So that in task thread function, we always have to poll the task interrupt flag and if interrupted, then throw exception to terminate the thread by itself.

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