Skip to content

Commit

Permalink
[SPARK-10722] RDDBlockId not found in driver-heartbeater
Browse files Browse the repository at this point in the history
## What changes were proposed in this pull request?

To ensure that the deserialization of TaskMetrics uses a ClassLoader that knows about RDDBlockIds. The problem occurs only very rarely since it depends on which thread of the thread pool is used for the heartbeat.

I observe that the code in question has been largely rewritten for v2.0.0 of Spark and the problem no longer manifests. However it would seem reasonable to fix this for those users who need to continue with the 1.6 version for some time yet. Hence I have created a fix for the 1.6 code branch.

## How was this patch tested?

Due to the nature of the problem a reproducible testcase is difficult to produce. This problem was causing our application's nightly integration tests to fail randomly. Since applying the fix the tests have not failed due to this problem, for nearly six weeks now.

Author: Simon Scott <[email protected]>

Closes apache#13222 from simonjscott/fix-10722.
  • Loading branch information
simonjscott authored and srowen committed May 26, 2016
1 parent 9a18115 commit 5cc1e2c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/src/main/scala/org/apache/spark/executor/Executor.scala
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,9 @@ private[spark] class Executor(
// 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))
val copiedMetrics = Utils.deserialize[TaskMetrics](
Utils.serialize(metrics),
Utils.getContextOrSparkClassLoader)
tasksMetrics += ((taskRunner.taskId, copiedMetrics))
} else {
// It will be copied by serialization
Expand Down

0 comments on commit 5cc1e2c

Please sign in to comment.