Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-12265][Mesos] Spark calls System.exit inside driver instead of throwing exception #10729

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ private[spark] class CoarseMesosSchedulerBackend(

override def error(d: SchedulerDriver, message: String) {
logError(s"Mesos error: $message")
markErr()
scheduler.error(message)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,7 @@ private[spark] class MesosClusterScheduler(
override def slaveLost(driver: SchedulerDriver, slaveId: SlaveID): Unit = {}
override def error(driver: SchedulerDriver, error: String): Unit = {
logError("Error received: " + error)
markErr()
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@ private[spark] class MesosSchedulerBackend(
override def error(d: SchedulerDriver, message: String) {
inClassLoader() {
logError("Mesos error: " + message)
markErr()
scheduler.error(message)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,19 +109,17 @@ private[mesos] trait MesosSchedulerUtils extends Logging {

new Thread(Utils.getFormattedClassName(this) + "-mesos-driver") {
setDaemon(true)

override def run() {
mesosDriver = newDriver
try {
mesosDriver = newDriver
val ret = mesosDriver.run()
logInfo("driver.run() returned with code " + ret)
if (ret != null && ret.equals(Status.DRIVER_ABORTED)) {
System.exit(1)
logError("Error starting driver, DRIVER_ABORTED")
}
} catch {
case e: Exception => {
logError("driver.run() failed", e)
System.exit(1)
}
}
}
Expand All @@ -144,6 +142,10 @@ private[mesos] trait MesosSchedulerUtils extends Logging {
registerLatch.countDown()
}

protected def markErr(): Unit = {
registerLatch.countDown()
}

def createResource(name: String, amount: Double, role: Option[String] = None): Resource = {
val builder = Resource.newBuilder()
.setName(name)
Expand Down