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_r369860669
##########
File path: core/src/main/scala/org/apache/spark/status/AppStatusListener.scala
##########
@@ -772,6 +772,11 @@ private[spark] class AppStatusListener(
event.maxOnHeapMem.foreach { _ =>
exec.totalOnHeap = event.maxOnHeapMem.get
exec.totalOffHeap = event.maxOffHeapMem.get
+ // SPARK-30594: whenever(first time or re-register) a BlockManager
added, all blocks
+ // from this BlockManager will be reported to driver later. So, we
should clean up
+ // used memory to avoid overlapped count.
+ exec.usedOnHeap = 0
+ exec.usedOffHeap = 0
Review comment:
It should be easy to add a new test case in `AppStatusListenerSuite` to
enforce the behavior.
----------------------------------------------------------------
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]