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/05/07 22:34:43 UTC

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

dongjoon-hyun 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_r281855082
 
 

 ##########
 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 is outdated i.e. 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 isTaskOutdated(taskId: String, state: MesosClusterSubmissionState): Boolean =
+    taskId != state.taskId.getValue && !pendingRetryDrivers.contains(state.driverDescription)
 
 Review comment:
   @samvantran . This works, but `pendingRetryDrivers` are assumed to be keyed by submission id. We should use `pendingRetryDrivers.exists(_.submissionId == state.driverDescription.submissionId)` instead of `pendingRetryDrivers.contains` to be robust. Could you fix like that?

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