Skip to content
Snippets Groups Projects
Commit a3c51c6e authored by Davis Shepherd's avatar Davis Shepherd Committed by Patrick Wendell
Browse files

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 <davis@conviva.com>

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
parent b5bae849
No related branches found
No related tags found
No related merge requests found
...@@ -83,7 +83,6 @@ private[ui] class JobProgressListener(conf: SparkConf) extends SparkListener { ...@@ -83,7 +83,6 @@ private[ui] class JobProgressListener(conf: SparkConf) extends SparkListener {
if (stages.size > retainedStages) { if (stages.size > retainedStages) {
val toRemove = math.max(retainedStages / 10, 1) val toRemove = math.max(retainedStages / 10, 1)
stages.take(toRemove).foreach { s => stages.take(toRemove).foreach { s =>
stageIdToTaskData.remove(s.stageId)
stageIdToTime.remove(s.stageId) stageIdToTime.remove(s.stageId)
stageIdToShuffleRead.remove(s.stageId) stageIdToShuffleRead.remove(s.stageId)
stageIdToShuffleWrite.remove(s.stageId) stageIdToShuffleWrite.remove(s.stageId)
...@@ -92,8 +91,10 @@ private[ui] class JobProgressListener(conf: SparkConf) extends SparkListener { ...@@ -92,8 +91,10 @@ private[ui] class JobProgressListener(conf: SparkConf) extends SparkListener {
stageIdToTasksActive.remove(s.stageId) stageIdToTasksActive.remove(s.stageId)
stageIdToTasksComplete.remove(s.stageId) stageIdToTasksComplete.remove(s.stageId)
stageIdToTasksFailed.remove(s.stageId) stageIdToTasksFailed.remove(s.stageId)
stageIdToTaskData.remove(s.stageId)
stageIdToExecutorSummaries.remove(s.stageId)
stageIdToPool.remove(s.stageId) stageIdToPool.remove(s.stageId)
if (stageIdToDescription.contains(s.stageId)) {stageIdToDescription.remove(s.stageId)} stageIdToDescription.remove(s.stageId)
} }
stages.trimStart(toRemove) stages.trimStart(toRemove)
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment