Skip to content

Commit a3c51c6

Browse files
Davis Shepherdpwendell
authored andcommitted
SPARK-1432: Make sure that all metadata fields are properly cleaned
While working on spark-1337 with @pwendell, we noticed that not all of the metadata maps in JobProgessListener were being properly cleaned. This could lead to a (hypothetical) memory leak issue should a job run long enough. This patch aims to address the issue. Author: Davis Shepherd <[email protected]> Closes #338 from dgshep/master and squashes the following commits: a77b65c [Davis Shepherd] In the contex of SPARK-1337: Make sure that all metadata fields are properly cleaned
1 parent b5bae84 commit a3c51c6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

core/src/main/scala/org/apache/spark/ui/jobs/JobProgressListener.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ private[ui] class JobProgressListener(conf: SparkConf) extends SparkListener {
8383
if (stages.size > retainedStages) {
8484
val toRemove = math.max(retainedStages / 10, 1)
8585
stages.take(toRemove).foreach { s =>
86-
stageIdToTaskData.remove(s.stageId)
8786
stageIdToTime.remove(s.stageId)
8887
stageIdToShuffleRead.remove(s.stageId)
8988
stageIdToShuffleWrite.remove(s.stageId)
@@ -92,8 +91,10 @@ private[ui] class JobProgressListener(conf: SparkConf) extends SparkListener {
9291
stageIdToTasksActive.remove(s.stageId)
9392
stageIdToTasksComplete.remove(s.stageId)
9493
stageIdToTasksFailed.remove(s.stageId)
94+
stageIdToTaskData.remove(s.stageId)
95+
stageIdToExecutorSummaries.remove(s.stageId)
9596
stageIdToPool.remove(s.stageId)
96-
if (stageIdToDescription.contains(s.stageId)) {stageIdToDescription.remove(s.stageId)}
97+
stageIdToDescription.remove(s.stageId)
9798
}
9899
stages.trimStart(toRemove)
99100
}

0 commit comments

Comments
 (0)