Skip to content

Commit 09deb3e

Browse files
andrewor14pwendell
authored andcommitted
[SPARK-2144] ExecutorsPage reports incorrect # of RDD blocks
This is reproducible whenever we drop a block because of memory pressure. This is because StorageStatusListener actually never removes anything from the block maps of its StorageStatuses. Instead, when a block is dropped, it sets the block's storage level to `StorageLevel.NONE`, when it should just remove it from the map. This PR includes this simple fix. Author: Andrew Or <[email protected]> Closes #1080 from andrewor14/ui-blocks and squashes the following commits: fcf9f1a [Andrew Or] Remove BlockStatus if it is no longer cached
1 parent 23a12ce commit 09deb3e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

core/src/main/scala/org/apache/spark/storage/StorageStatusListener.scala

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ class StorageStatusListener extends SparkListener {
3737
val filteredStatus = storageStatusList.find(_.blockManagerId.executorId == execId)
3838
filteredStatus.foreach { storageStatus =>
3939
updatedBlocks.foreach { case (blockId, updatedStatus) =>
40-
storageStatus.blocks(blockId) = updatedStatus
40+
if (updatedStatus.storageLevel == StorageLevel.NONE) {
41+
storageStatus.blocks.remove(blockId)
42+
} else {
43+
storageStatus.blocks(blockId) = updatedStatus
44+
}
4145
}
4246
}
4347
}

0 commit comments

Comments
 (0)