Skip to content
Snippets Groups Projects
Commit 6cef0183 authored by Sean Owen's avatar Sean Owen Committed by Reynold Xin
Browse files

[SPARK-16376][WEBUI][SPARK WEB UI][APP-ID] HTTP ERROR 500 when using rest api...

[SPARK-16376][WEBUI][SPARK WEB UI][APP-ID] HTTP ERROR 500 when using rest api "/applications//jobs" if array "stageIds" is empty

## What changes were proposed in this pull request?

Avoid error finding max of empty Seq when stageIds is empty. It does fix the immediate problem; I don't know if it results in meaningful output, but not an error at least.

## How was this patch tested?

Jenkins tests

Author: Sean Owen <sowen@cloudera.com>

Closes #14105 from srowen/SPARK-16376.
parent fd6e8f0e
No related branches found
No related tags found
No related merge requests found
......@@ -68,7 +68,12 @@ private[v1] object AllJobsResource {
listener: JobProgressListener,
includeStageDetails: Boolean): JobData = {
listener.synchronized {
val lastStageInfo = listener.stageIdToInfo.get(job.stageIds.max)
val lastStageInfo =
if (job.stageIds.isEmpty) {
None
} else {
listener.stageIdToInfo.get(job.stageIds.max)
}
val lastStageData = lastStageInfo.flatMap { s =>
listener.stageIdToData.get((s.stageId, s.attemptId))
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment