Skip to content

Commit 7c879e0

Browse files
committed
add more comments
1 parent 754b5b8 commit 7c879e0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

core/src/main/scala/org/apache/spark/executor/Executor.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,10 +361,13 @@ private[spark] class Executor(
361361
Option(taskRunner.task).flatMap(_.metrics).foreach { metrics =>
362362
metrics.updateShuffleReadMetrics
363363
if (isLocal) {
364-
// make a deep copy of it
364+
// JobProgressListener will hold an reference of it during
365+
// onExecutorMetricsUpdate(), then JobProgressListener can not see
366+
// the changes of metrics any more, so make a deep copy of it
365367
val copiedMetrics = Utils.deserialize[TaskMetrics](Utils.serialize(metrics))
366368
tasksMetrics += ((taskRunner.taskId, copiedMetrics))
367369
} else {
370+
// It will be copied by serialization
368371
tasksMetrics += ((taskRunner.taskId, metrics))
369372
}
370373
}

0 commit comments

Comments
 (0)