Skip to content

Commit

Permalink
[SPARK-16376][WEBUI][SPARK WEB UI][APP-ID] HTTP ERROR 500 when using …
Browse files Browse the repository at this point in the history
…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 <[email protected]>

Closes apache#14105 from srowen/SPARK-16376.
  • Loading branch information
srowen authored and rxin committed Jul 9, 2016
1 parent fd6e8f0 commit 6cef018
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Expand Down

0 comments on commit 6cef018

Please sign in to comment.