[#2411] fix(spark): Avoid double release memory when trigger spill#2412
[#2411] fix(spark): Avoid double release memory when trigger spill#2412summaryzb wants to merge 1 commit intoapache:masterfrom
Conversation
Test Results 2 945 files - 66 2 945 suites - 66 9h 43m 8s ⏱️ + 2h 58m 31s For more details on these failures and errors, see this check. Results for commit 4d4a5d5. ± Comparison against base commit 3874f15. This pull request removes 30 tests. |
| // ignore | ||
| } | ||
| } | ||
| return 0L; |
There was a problem hiding this comment.
From my point, the return value is to tell spark memory manager we have released, that will not duplicate release.
There was a problem hiding this comment.
I see, but does it really necessary to block here to calculate memory released. since the free memory is called in multiply callback thread
There was a problem hiding this comment.
Sorry, I havn't fully gotten your thought. The returned free memory size is to tell spark the spilled size.
If you don't mind, please provide more details?
There was a problem hiding this comment.
free memoryis called in multiply callback thread
freeMemory of MemoryConsumer is called in multiply callback thread, but used in MemoryConsumer is a normal variable, There is a high probability that concurrent issue happens
There was a problem hiding this comment.
Emm. I have to say that the spill only will be triggered by self.
if (!memorySpillEnabled || trigger != this) {
return 0L;
}
What changes were proposed in this pull request?
When trigger spill, return 0 instead of the memory number of sent block.
Why are the changes needed?
Fix #2411
Does this PR introduce any user-facing change?
No.
How was this patch tested?
UT