Skip to content

Commit 6fbe0d8

Browse files
author
Marcelo Vanzin
committed
Better handle failures when loading app info.
Instead of failing to load all the applications, just ignore the one that failed.
1 parent eee2f5a commit 6fbe0d8

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

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

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -129,16 +129,21 @@ class FsHistoryProvider(conf: SparkConf) extends ApplicationHistoryProvider
129129
// For any application that either (i) is not listed or (ii) has changed since the last time
130130
// the listing was created (defined by the log dir's modification time), load the app's info.
131131
// Otherwise just reuse what's already in memory.
132-
appList.set(logInfos
133-
.map { dir =>
134-
val curr = currentApps.getOrElse(dir.getPath().getName(), null)
135-
if (curr == null || curr.lastUpdated < getModificationTime(dir)) {
136-
loadAppInfo(dir, false)
137-
} else {
138-
curr
132+
val newApps = new mutable.ListBuffer[ApplicationHistoryInfo]
133+
for (dir <- logInfos) {
134+
val curr = currentApps.getOrElse(dir.getPath().getName(), null)
135+
if (curr == null || curr.lastUpdated < getModificationTime(dir)) {
136+
try {
137+
newApps += loadAppInfo(dir, false)
138+
} catch {
139+
case e: Exception => logError(s"Failed to load app info from directory $dir.")
139140
}
141+
} else {
142+
newApps += curr
140143
}
141-
.sortBy { info => -info.lastUpdated })
144+
}
145+
146+
appList.set(newApps.sortBy { info => -info.lastUpdated })
142147
} catch {
143148
case t: Throwable => logError("Exception in checking for event log updates", t)
144149
}

0 commit comments

Comments
 (0)