Skip to content

Commit 0dc3ea7

Browse files
committed
if app isnt found, reload apps from FS before giving up
1 parent c7d884f commit 0dc3ea7

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

core/src/main/scala/org/apache/spark/deploy/history/FsHistoryProvider.scala

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,11 @@ private[history] class FsHistoryProvider(conf: SparkConf) extends ApplicationHis
148148

149149
override def getAppUI(appId: String): Option[SparkUI] = {
150150
try {
151-
applications.get(appId).map { info =>
151+
val appOpt = applications.get(appId).orElse {
152+
getListing(true)
153+
applications.get(appId)
154+
}
155+
appOpt.map { info =>
152156
val replayBus = new ReplayListenerBus()
153157
val ui = {
154158
val conf = this.conf.clone()

core/src/main/scala/org/apache/spark/deploy/history/HistoryServer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class HistoryServer(
5353

5454
private val appLoader = new CacheLoader[String, SparkUI] {
5555
override def load(key: String): SparkUI = {
56-
val ui = provider.getAppUI(key).getOrElse(throw new NoSuchElementException())
56+
val ui = provider.getAppUI(key).getOrElse(throw new NoSuchElementException(s"no app with key $key"))
5757
attachSparkUI(ui)
5858
ui
5959
}

0 commit comments

Comments
 (0)