jiangxb1987 commented on a change in pull request #27306: [SPARK-30594][CORE]
Do not post SparkListenerBlockUpdated when updateBlockInfo returns false
URL: https://github.com/apache/spark/pull/27306#discussion_r369860179
##########
File path:
core/src/main/scala/org/apache/spark/storage/BlockManagerMasterEndpoint.scala
##########
@@ -98,8 +98,15 @@ class BlockManagerMasterEndpoint(
case _updateBlockInfo @
UpdateBlockInfo(blockManagerId, blockId, storageLevel,
deserializedSize, size) =>
- context.reply(updateBlockInfo(blockManagerId, blockId, storageLevel,
deserializedSize, size))
-
listenerBus.post(SparkListenerBlockUpdated(BlockUpdatedInfo(_updateBlockInfo)))
+ val succeed = updateBlockInfo(blockManagerId, blockId, storageLevel,
deserializedSize, size)
+ context.reply(succeed)
+ // SPARK-30594: we should not post `SparkListenerBlockUpdated` when
updateBlockInfo
+ // returns false, which may causes negative memory usage in UI(see
SPARK-30465). In
+ // this case, that BlockManager will re-register and report all blocks
to driver later.
+ // So, we should avoid to post the same block for two times.
+ if (succeed) {
Review comment:
We should be able to add one test case for it in `BlockManagerSuite` ?
----------------------------------------------------------------
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]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]