aboutsummaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
Diffstat (limited to 'core/src')
-rw-r--r--core/src/main/scala/org/apache/spark/deploy/history/HistoryServer.scala16
1 files changed, 14 insertions, 2 deletions
diff --git a/core/src/main/scala/org/apache/spark/deploy/history/HistoryServer.scala b/core/src/main/scala/org/apache/spark/deploy/history/HistoryServer.scala
index 0bc0cb1c15..6143a33b69 100644
--- a/core/src/main/scala/org/apache/spark/deploy/history/HistoryServer.scala
+++ b/core/src/main/scala/org/apache/spark/deploy/history/HistoryServer.scala
@@ -21,6 +21,8 @@ import java.util.NoSuchElementException
import java.util.zip.ZipOutputStream
import javax.servlet.http.{HttpServlet, HttpServletRequest, HttpServletResponse}
+import scala.util.control.NonFatal
+
import com.google.common.cache._
import org.eclipse.jetty.servlet.{ServletContextHandler, ServletHolder}
import org.apache.spark.{Logging, SecurityManager, SparkConf}
@@ -113,7 +115,17 @@ class HistoryServer(
}
def getSparkUI(appKey: String): Option[SparkUI] = {
- Option(appCache.get(appKey))
+ try {
+ val ui = appCache.get(appKey)
+ Some(ui)
+ } catch {
+ case NonFatal(e) => e.getCause() match {
+ case nsee: NoSuchElementException =>
+ None
+
+ case cause: Exception => throw cause
+ }
+ }
}
initialize()
@@ -193,7 +205,7 @@ class HistoryServer(
appCache.get(appId + attemptId.map { id => s"/$id" }.getOrElse(""))
true
} catch {
- case e: Exception => e.getCause() match {
+ case NonFatal(e) => e.getCause() match {
case nsee: NoSuchElementException =>
false