[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.
This commit is contained in:
parent
fd6e8f0e22
commit
6cef0183c0
|
@ -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))
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue