Github user mridulm commented on a diff in the pull request:

    https://github.com/apache/spark/pull/16189#discussion_r92914652
  
    --- Diff: core/src/main/scala/org/apache/spark/executor/Executor.scala ---
    @@ -148,9 +161,23 @@ private[spark] class Executor(
       }
     
       def killTask(taskId: Long, interruptThread: Boolean): Unit = {
    -    val tr = runningTasks.get(taskId)
    -    if (tr != null) {
    -      tr.kill(interruptThread)
    +    val taskRunner = runningTasks.get(taskId)
    +    if (taskRunner != null) {
    +      if (taskReaperEnabled) {
    +        taskReaperForTask.synchronized {
    +          val shouldCreateReaper = taskReaperForTask.get(taskId) match {
    +            case None => true
    +            case Some(existingReaper) => interruptThread && 
!existingReaper.interruptThread
    +          }
    +          if (shouldCreateReaper) {
    +            val taskReaper = new TaskReaper(taskRunner, interruptThread = 
interruptThread)
    +            taskReaperForTask(taskId) = taskReaper
    +            taskReaperPool.execute(taskReaper)
    --- End diff --
    
    Nit: Would be great if the execute is outside the synchronized block. 
Should not be an issue here though, but just paranoia ...


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to