-
Notifications
You must be signed in to change notification settings - Fork 28.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK-23121][WEB-UI] When the Spark Streaming app is running for a period of time, the page is incorrectly reported when accessing '/jobs' or '/jobs/job?id=13' #20287
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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,17 +430,24 @@ 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 = "" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of catching the exception the logic should be modified to be prepared for a missing stageAttempt. |
||
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) | ||
|
||
val detailUrl = "%s/jobs/job?id=%s".format(basePath, jobData.jobId) | ||
|
||
new JobTableRowData( | ||
jobData, | ||
lastStageAttempt.name, | ||
lastStageAttemptName, | ||
lastStageDescription, | ||
duration.getOrElse(-1), | ||
formattedDuration, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here. We should avoid the situation when the exception is thrown. Catching the exception and doing nothing just hides the problems. |
||
|
||
if (shouldShowActiveStages) { | ||
content ++= <h4 id="active">Active Stages ({activeStages.size})</h4> ++ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, you're catching all exceptions. This should check whether the last stage attempt exists rather than catching anything that goes wrong.
I don't think it's correct to pretend it exists but is empty. The request is for something that doesn't exist and ideally generates a 404.