diff options
author | Andrew Or <andrewor14@gmail.com> | 2014-03-20 14:13:16 -0700 |
---|---|---|
committer | Patrick Wendell <pwendell@gmail.com> | 2014-03-20 14:13:16 -0700 |
commit | ca76423e23f5f626c56041cecbc38a93ae1e0298 (patch) | |
tree | f86cd6d42f4c4b3a66c3a18d77dfd87e8da95db1 /core/src | |
parent | 66a03e5fe0167f590d150e099b15902e826a188f (diff) | |
download | spark-ca76423e23f5f626c56041cecbc38a93ae1e0298.tar.gz spark-ca76423e23f5f626c56041cecbc38a93ae1e0298.tar.bz2 spark-ca76423e23f5f626c56041cecbc38a93ae1e0298.zip |
[Hot Fix #42] Do not stop SparkUI if bind() is not called
This is a bug fix for #42 (79d07d66040f206708e14de393ab0b80020ed96a).
In Master, we do not bind() each SparkUI because we do not want to start a server for each finished application. However, when we remove the associated application, we call stop() on the SparkUI, which throws an assertion failure.
This fix ensures we don't call stop() on a SparkUI that was never bind()'ed.
Author: Andrew Or <andrewor14@gmail.com>
Closes #188 from andrewor14/ui-fix and squashes the following commits:
94a925f [Andrew Or] Do not stop SparkUI if bind() is not called
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/main/scala/org/apache/spark/deploy/master/Master.scala | 11 |
1 files changed, 2 insertions, 9 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 1fd2114169..9ed49e01be 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 @@ -149,7 +149,6 @@ private[spark] class Master( override def postStop() { webUi.stop() - appIdToUI.values.foreach(_.stop()) masterMetricsSystem.stop() applicationMetricsSystem.stop() persistenceEngine.close() @@ -622,10 +621,7 @@ private[spark] class Master( if (completedApps.size >= RETAINED_APPLICATIONS) { val toRemove = math.max(RETAINED_APPLICATIONS / 10, 1) completedApps.take(toRemove).foreach( a => { - appIdToUI.remove(a.id).foreach { ui => - ui.stop() - webUi.detachUI(ui) - } + appIdToUI.remove(a.id).foreach { ui => webUi.detachUI(ui) } applicationMetricsSystem.removeSource(a.appSource) }) completedApps.trimStart(toRemove) @@ -681,10 +677,7 @@ private[spark] class Master( // Do not call ui.bind() to avoid creating a new server for each application ui.start() val success = replayerBus.replay(eventLogDir) - if (!success) { - ui.stop() - None - } else Some(ui) + if (success) Some(ui) else None } /** Generate a new app ID given a app's submission date */ |