diff options
author | Patrick Wendell <pwendell@gmail.com> | 2013-12-29 12:12:50 -0800 |
---|---|---|
committer | Patrick Wendell <pwendell@gmail.com> | 2013-12-29 12:12:58 -0800 |
commit | 7a99702ce2fb04c4d76f0ce9f6df6608e0a5cce1 (patch) | |
tree | df383a01c0e0373999652bc758760a9f17704aea | |
parent | a8729770f5dc944444b9996716c2f6a26485a819 (diff) | |
download | spark-7a99702ce2fb04c4d76f0ce9f6df6608e0a5cce1.tar.gz spark-7a99702ce2fb04c4d76f0ce9f6df6608e0a5cce1.tar.bz2 spark-7a99702ce2fb04c4d76f0ce9f6df6608e0a5cce1.zip |
Respect supervise option at Master
-rw-r--r-- | core/src/main/scala/org/apache/spark/deploy/master/Master.scala | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/core/src/main/scala/org/apache/spark/deploy/master/Master.scala b/core/src/main/scala/org/apache/spark/deploy/master/Master.scala index b8655c78db..29f20daacd 100644 --- a/core/src/main/scala/org/apache/spark/deploy/master/Master.scala +++ b/core/src/main/scala/org/apache/spark/deploy/master/Master.scala @@ -396,8 +396,14 @@ private[spark] class Master(host: String, port: Int, webUiPort: Int) extends Act // Reschedule drivers which were not claimed by any workers drivers.filter(_.worker.isEmpty).foreach { d => - logWarning(s"Driver ${d.id} was not found after master recovery, re-launching") - relaunchDriver(d) + logWarning(s"Driver ${d.id} was not found after master recovery") + if (d.desc.supervise) { + logWarning(s"Re-launching ${d.id}") + relaunchDriver(d) + } else { + removeDriver(d.id, DriverState.FAILED, None) + logWarning(s"Did not re-launch ${d.id} because it was not supervised") + } } state = RecoveryState.ALIVE @@ -519,7 +525,13 @@ private[spark] class Master(host: String, port: Int, webUiPort: Int) extends Act exec.application.removeExecutor(exec) } for (driver <- worker.drivers.values) { - relaunchDriver(driver) + if (driver.desc.supervise) { + logInfo(s"Re-launching ${driver.id}") + relaunchDriver(driver) + } else { + logInfo(s"Not re-launching ${driver.id} because it was not supervised") + removeDriver(driver.id, DriverState.FAILED, None) + } } persistenceEngine.removeWorker(worker) } |