From 7c879e0b3deb7c3d5788cae5dc7e459cce6f84d6 Mon Sep 17 00:00:00 2001 From: Davies Liu Date: Thu, 11 Sep 2014 16:53:41 -0700 Subject: [PATCH] add more comments --- core/src/main/scala/org/apache/spark/executor/Executor.scala | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/src/main/scala/org/apache/spark/executor/Executor.scala b/core/src/main/scala/org/apache/spark/executor/Executor.scala index afba6d8e5f49e..acae448a9c66f 100644 --- a/core/src/main/scala/org/apache/spark/executor/Executor.scala +++ b/core/src/main/scala/org/apache/spark/executor/Executor.scala @@ -361,10 +361,13 @@ private[spark] class Executor( Option(taskRunner.task).flatMap(_.metrics).foreach { metrics => metrics.updateShuffleReadMetrics if (isLocal) { - // make a deep copy of it + // JobProgressListener will hold an reference of it during + // onExecutorMetricsUpdate(), then JobProgressListener can not see + // the changes of metrics any more, so make a deep copy of it val copiedMetrics = Utils.deserialize[TaskMetrics](Utils.serialize(metrics)) tasksMetrics += ((taskRunner.taskId, copiedMetrics)) } else { + // It will be copied by serialization tasksMetrics += ((taskRunner.taskId, metrics)) } }