aboutsummaryrefslogtreecommitdiff
path: root/yarn
diff options
context:
space:
mode:
authorAndrew Or <andrewor14@gmail.com>2014-09-11 17:18:46 -0700
committerAndrew Or <andrewor14@gmail.com>2014-09-11 17:18:46 -0700
commit6324eb7b5b0ae005cb2e913e36b1508bd6f1b9b8 (patch)
tree2286711eef4eaf26d023aa609b2f5d11dafdfdec /yarn
parent4bc9e046cb8922923dff254e3e621fb4de656f98 (diff)
downloadspark-6324eb7b5b0ae005cb2e913e36b1508bd6f1b9b8.tar.gz
spark-6324eb7b5b0ae005cb2e913e36b1508bd6f1b9b8.tar.bz2
spark-6324eb7b5b0ae005cb2e913e36b1508bd6f1b9b8.zip
[Spark-3490] Disable SparkUI for tests
We currently open many ephemeral ports during the tests, and as a result we occasionally can't bind to new ones. This has caused the `DriverSuite` and the `SparkSubmitSuite` to fail intermittently. By disabling the `SparkUI` when it's not needed, we already cut down on the number of ports opened significantly, on the order of the number of `SparkContexts` ever created. We must keep it enabled for a few tests for the UI itself, however. Author: Andrew Or <andrewor14@gmail.com> Closes #2363 from andrewor14/disable-ui-for-tests and squashes the following commits: 332a7d5 [Andrew Or] No need to set spark.ui.port to 0 anymore 30c93a2 [Andrew Or] Simplify streaming UISuite a431b84 [Andrew Or] Fix streaming test failures 8f5ae53 [Andrew Or] Fix no new line at the end 29c9b5b [Andrew Or] Disable SparkUI for tests
Diffstat (limited to 'yarn')
-rw-r--r--yarn/common/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala2
-rw-r--r--yarn/common/src/main/scala/org/apache/spark/scheduler/cluster/YarnClientSchedulerBackend.scala2
2 files changed, 2 insertions, 2 deletions
diff --git a/yarn/common/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala b/yarn/common/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala
index 5756263e89..878b6db546 100644
--- a/yarn/common/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala
+++ b/yarn/common/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala
@@ -189,7 +189,7 @@ private[spark] class ApplicationMaster(args: ApplicationMasterArguments,
if (sc == null) {
finish(FinalApplicationStatus.FAILED, "Timed out waiting for SparkContext.")
} else {
- registerAM(sc.ui.appUIAddress, securityMgr)
+ registerAM(sc.ui.map(_.appUIAddress).getOrElse(""), securityMgr)
try {
userThread.join()
} finally {
diff --git a/yarn/common/src/main/scala/org/apache/spark/scheduler/cluster/YarnClientSchedulerBackend.scala b/yarn/common/src/main/scala/org/apache/spark/scheduler/cluster/YarnClientSchedulerBackend.scala
index 41c662cd7a..6aa6475fe4 100644
--- a/yarn/common/src/main/scala/org/apache/spark/scheduler/cluster/YarnClientSchedulerBackend.scala
+++ b/yarn/common/src/main/scala/org/apache/spark/scheduler/cluster/YarnClientSchedulerBackend.scala
@@ -55,7 +55,7 @@ private[spark] class YarnClientSchedulerBackend(
val driverHost = conf.get("spark.driver.host")
val driverPort = conf.get("spark.driver.port")
val hostport = driverHost + ":" + driverPort
- conf.set("spark.driver.appUIAddress", sc.ui.appUIHostPort)
+ sc.ui.foreach { ui => conf.set("spark.driver.appUIAddress", ui.appUIHostPort) }
val argsArrayBuf = new ArrayBuffer[String]()
argsArrayBuf += (