diff --git a/core/src/main/scala/org/apache/spark/ui/jobs/AllJobsPage.scala b/core/src/main/scala/org/apache/spark/ui/jobs/AllJobsPage.scala index ff916bb6a5759..eca9cea803271 100644 --- a/core/src/main/scala/org/apache/spark/ui/jobs/AllJobsPage.scala +++ b/core/src/main/scala/org/apache/spark/ui/jobs/AllJobsPage.scala @@ -65,10 +65,13 @@ private[ui] class AllJobsPage(parent: JobsTab, store: AppStatusStore) extends We }.map { job => val jobId = job.jobId val status = job.status - val jobDescription = store.lastStageAttempt(job.stageIds.max).description - val displayJobDescription = jobDescription - .map(UIUtils.makeDescription(_, "", plainText = true).text) - .getOrElse("") + var displayJobDescription = "" + try { + displayJobDescription = store.lastStageAttempt(job.stageIds.max).description + .map(UIUtils.makeDescription(_, "", plainText = true).text).getOrElse("") + } catch { + case e => displayJobDescription = job.description.getOrElse("") + } val submissionTime = job.submissionTime.get.getTime() val completionTime = job.completionTime.map(_.getTime()).getOrElse(System.currentTimeMillis()) val classNameByStatus = status match { @@ -427,9 +430,16 @@ private[ui] class JobDataSource( val formattedDuration = duration.map(d => UIUtils.formatDuration(d)).getOrElse("Unknown") val submissionTime = jobData.submissionTime val formattedSubmissionTime = submissionTime.map(UIUtils.formatDate).getOrElse("Unknown") - val lastStageAttempt = store.lastStageAttempt(jobData.stageIds.max) - val lastStageDescription = lastStageAttempt.description.getOrElse("") - + var lastStageDescription = "" + var lastStageAttemptName = "" + try { + val lastStageAttempt = store.lastStageAttempt(jobData.stageIds.max) + lastStageDescription = lastStageAttempt.description.getOrElse("") + } catch { + case e => + lastStageDescription = jobData.description.getOrElse("") + lastStageAttemptName = jobData.name + } val formattedJobDescription = UIUtils.makeDescription(lastStageDescription, basePath, plainText = false) @@ -437,7 +447,7 @@ private[ui] class JobDataSource( new JobTableRowData( jobData, - lastStageAttempt.name, + lastStageAttemptName, lastStageDescription, duration.getOrElse(-1), formattedDuration, diff --git a/core/src/main/scala/org/apache/spark/ui/jobs/JobPage.scala b/core/src/main/scala/org/apache/spark/ui/jobs/JobPage.scala index bf59152c8c0cd..39f03cfbcb1a0 100644 --- a/core/src/main/scala/org/apache/spark/ui/jobs/JobPage.scala +++ b/core/src/main/scala/org/apache/spark/ui/jobs/JobPage.scala @@ -335,9 +335,12 @@ private[ui] class JobPage(parent: JobsTab, store: AppStatusStore) extends WebUIP content ++= makeTimeline(activeStages ++ completedStages ++ failedStages, store.executorList(false), appStartTime) - - content ++= UIUtils.showDagVizForJob( - jobId, store.operationGraphForJob(jobId)) + try { + content ++= UIUtils.showDagVizForJob( + jobId, store.operationGraphForJob(jobId)) + } catch { + case e => None + } if (shouldShowActiveStages) { content ++=

Active Stages ({activeStages.size})

++