Repository: spark
Updated Branches:
  refs/heads/branch-1.3 6a1e0f967 -> 832625509


[SPARK-5703] AllJobsPage throws empty.max exception

If you have a `SparkListenerJobEnd` event without the corresponding 
`SparkListenerJobStart` event, then `JobProgressListener` will create an empty 
`JobUIData` with an empty `stageIds` list. However, later in `AllJobsPage` we 
call `stageIds.max`. If this is empty, it will throw an exception.

This crashed my history server.

Author: Andrew Or <and...@databricks.com>

Closes #4490 from andrewor14/jobs-page-max and squashes the following commits:

21797d3 [Andrew Or] Check nonEmpty before calling max

(cherry picked from commit a95ed52157473fb0e42e910ee15270e7f0edf943)
Signed-off-by: Andrew Or <and...@databricks.com>


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/83262550
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/83262550
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/83262550

Branch: refs/heads/branch-1.3
Commit: 832625509c36332baad377448f55a6cfc0337121
Parents: 6a1e0f9
Author: Andrew Or <and...@databricks.com>
Authored: Mon Feb 9 21:18:48 2015 -0800
Committer: Andrew Or <and...@databricks.com>
Committed: Mon Feb 9 21:18:53 2015 -0800

----------------------------------------------------------------------
 core/src/main/scala/org/apache/spark/ui/jobs/AllJobsPage.scala | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/83262550/core/src/main/scala/org/apache/spark/ui/jobs/AllJobsPage.scala
----------------------------------------------------------------------
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 045c69d..bd923d7 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
@@ -42,7 +42,9 @@ private[ui] class AllJobsPage(parent: JobsTab) extends 
WebUIPage("") {
     }
 
     def makeRow(job: JobUIData): Seq[Node] = {
-      val lastStageInfo = listener.stageIdToInfo.get(job.stageIds.max)
+      val lastStageInfo = Option(job.stageIds)
+        .filter(_.nonEmpty)
+        .flatMap { ids => listener.stageIdToInfo.get(ids.max) }
       val lastStageData = lastStageInfo.flatMap { s =>
         listener.stageIdToData.get((s.stageId, s.attemptId))
       }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to