diff options
author | Alex Bozarth <ajbozart@us.ibm.com> | 2015-12-21 14:06:36 -0800 |
---|---|---|
committer | Andrew Or <andrew@databricks.com> | 2015-12-21 14:06:36 -0800 |
commit | b0849b8aeafa801bb0561f1f6e46dc1d56c37c19 (patch) | |
tree | a9b1c144de1d6c3430716005ff37a54b8cfc64b0 | |
parent | fc6dbcc7038c2b030ef6a2dc8be5848499ccee1c (diff) | |
download | spark-b0849b8aeafa801bb0561f1f6e46dc1d56c37c19.tar.gz spark-b0849b8aeafa801bb0561f1f6e46dc1d56c37c19.tar.bz2 spark-b0849b8aeafa801bb0561f1f6e46dc1d56c37c19.zip |
[SPARK-12339][SPARK-11206][WEBUI] Added a null check that was removed in
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 <ajbozart@us.ibm.com>
Closes #10405 from ajbozarth/spark12339.
-rw-r--r-- | sql/core/src/main/scala/org/apache/spark/sql/execution/ui/SQLListener.scala | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/sql/core/src/main/scala/org/apache/spark/sql/execution/ui/SQLListener.scala b/sql/core/src/main/scala/org/apache/spark/sql/execution/ui/SQLListener.scala index e19a1e3e58..622e01c46e 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/execution/ui/SQLListener.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/execution/ui/SQLListener.scala @@ -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) + } } /** |