Skip to content

Commit 862b5b5

Browse files
committed
Support asking driver status when it's retrying.
1 parent 7f214c2 commit 862b5b5

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

core/src/main/scala/org/apache/spark/scheduler/cluster/mesos/MesosClusterScheduler.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,8 @@ private[spark] class MesosClusterScheduler(
446446
return StatusResponse(submissionId, true, Option("Driver is running"))
447447
} else if (finishedDrivers.contains(submissionId)) {
448448
return StatusResponse(submissionId, true, Option("Driver already finished"))
449+
} else if (superviseRetryList.contains(submissionId)) {
450+
return StatusResponse(submissionId, true, Option("Driver is retrying"))
449451
} else {
450452
return StatusResponse(submissionId, false, None)
451453
}

core/src/main/scala/org/apache/spark/scheduler/cluster/mesos/SuperviseRetryList.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ private[mesos] class SuperviseRetryList(state: ClusterPersistenceEngine) {
4646
}
4747
}
4848

49+
def contains(submissionId: String) =
50+
drivers.exists(d => d.submission.submissionId.equals(submissionId))
51+
4952
def getNextRetry(currentTime: Date): (Option[DriverSubmission], Option[RetryState]) = {
5053
val retry = drivers.find(d => d.nextRetry.before(currentTime))
5154
if (retry.isDefined) {

0 commit comments

Comments
 (0)