Skip to content

Commit

Permalink
[SPARK-12339][SPARK-11206][WEBUI] Added a null check that was removed in
Browse files Browse the repository at this point in the history
Updates made in SPARK-11206 missed an edge case which cause's a NullPointerException when a task is killed. In some cases when a task ends in failure taskMetrics is initialized as null (see JobProgressListener.onTaskEnd()). To address this a null check was added. Before the changes in SPARK-11206 this null check was called at the start of the updateTaskAccumulatorValues() function.

Author: Alex Bozarth <[email protected]>

Closes #10405 from ajbozarth/spark12339.
  • Loading branch information
ajbozarth authored and Andrew Or committed Dec 21, 2015
1 parent fc6dbcc commit b0849b8
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,14 @@ private[sql] class SQLListener(conf: SparkConf) extends SparkListener with Loggi
}

override def onTaskEnd(taskEnd: SparkListenerTaskEnd): Unit = synchronized {
updateTaskAccumulatorValues(
taskEnd.taskInfo.taskId,
taskEnd.stageId,
taskEnd.stageAttemptId,
taskEnd.taskMetrics.accumulatorUpdates(),
finishTask = true)
if (taskEnd.taskMetrics != null) {
updateTaskAccumulatorValues(
taskEnd.taskInfo.taskId,
taskEnd.stageId,
taskEnd.stageAttemptId,
taskEnd.taskMetrics.accumulatorUpdates(),
finishTask = true)
}
}

/**
Expand Down

0 comments on commit b0849b8

Please sign in to comment.