holdenk commented on a change in pull request #32790:
URL: https://github.com/apache/spark/pull/32790#discussion_r646182136



##########
File path: 
core/src/main/scala/org/apache/spark/storage/BlockManagerMasterEndpoint.scala
##########
@@ -276,8 +276,11 @@ class BlockManagerMasterEndpoint(
           val blockIdsToDel = 
blocksToDeleteByShuffleService.getOrElseUpdate(bmIdForShuffleService,
             new mutable.HashSet[RDDBlockId]())
           blockIdsToDel += blockId
-          blockStatusByShuffleService.get(bmIdForShuffleService).foreach { 
blockStatus =>
-            blockStatus.remove(blockId)
+          blockStatusByShuffleService.get(bmIdForShuffleService).foreach { 
blockStatusForId =>
+            blockStatusForId.remove(blockId)
+            if (blockStatusForId.isEmpty) {

Review comment:
       nit: can we add a comment about why we remove it here? (e.g the memory 
leak) because just reading the code through it might not be super obvious.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to