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/04/03 21:30:32 UTC

[GitHub] [spark] samvantran commented on a change in pull request #24276: [SPARK-27347][MESOS] Fix supervised driver retry logic for outdated tasks

samvantran commented on a change in pull request #24276: [SPARK-27347][MESOS] Fix supervised driver retry logic for outdated tasks
URL: https://github.com/apache/spark/pull/24276#discussion_r271940904
 
 

 ##########
 File path: resource-managers/mesos/src/main/scala/org/apache/spark/scheduler/cluster/mesos/MesosClusterScheduler.scala
 ##########
 @@ -786,6 +790,15 @@ private[spark] class MesosClusterScheduler(
     }
   }
 
+  /**
+   * Check if the task has already been launched or is pending
+   * If neither, the taskId is outdated and should be ignored
+   * This is to avoid scenarios where an outdated status update arrives
+   * after a supervised driver has already been relaunched
+   */
+  private def taskIsOutdated(taskId: String, state: MesosClusterSubmissionState): Boolean =
+    taskId != state.taskId.getValue && !pendingRetryDrivers.contains(state.driverDescription)
 
 Review comment:
   Yup. So in your example say: 
   ```
   - driver task01 running on agent1
   - agent1 crashes
   - job relaunched on agent2 as task01-retry-1
   - job finishes. Latest state.task.Id == task01-retry-1
   - agent1 comes back and tries to relaunch task01
   - this method would see that task01 =/= task01-retry-1 && 
     there aren't any pendingRetries and would return True
     preventing a zombie job from reviving
   ```

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