Skip to content

Commit c16fb5f

Browse files
author
Devaraj K
committed
[SPARK-15359] [Mesos] Mesos dispatcher should handle DRIVER_ABORTED status
from mesosDriver.run()
1 parent 8ad9f08 commit c16fb5f

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

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

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,25 @@ private[mesos] trait MesosSchedulerUtils extends Logging {
120120
val ret = mesosDriver.run()
121121
logInfo("driver.run() returned with code " + ret)
122122
if (ret != null && ret.equals(Status.DRIVER_ABORTED)) {
123-
error = Some(new SparkException("Error starting driver, DRIVER_ABORTED"))
124-
markErr()
123+
val ex = new SparkException("Error starting driver, DRIVER_ABORTED")
124+
// if the driver gets aborted after the successful registration
125+
if (registerLatch.getCount == 0) {
126+
throw ex
127+
} else {
128+
error = Some(ex)
129+
markErr()
130+
}
125131
}
126132
} catch {
127133
case e: Exception =>
128134
logError("driver.run() failed", e)
129-
error = Some(e)
130-
markErr()
135+
// if any exception occurs after the successful registration
136+
if (registerLatch.getCount == 0) {
137+
throw e
138+
} else {
139+
error = Some(e)
140+
markErr()
141+
}
131142
}
132143
}
133144
}.start()

0 commit comments

Comments
 (0)