Repository navigation
fix: expose native memory usage to Spark - #5408
Merged
sunchao merged 2 commits intoAug 24, 2026
Merged
Conversation
ywskycn
force-pushed
the
dev/codex/comet-expose-native-memory-usage
branch
from
August 21, 2026 15:42
18738e8 to
c2d112f
Compare
Contributor
Author
|
Thx @comphead . Updated with a unit test. Anything else you think we should include? |
sunchao
approved these changes
Aug 22, 2026
ywskycn
force-pushed
the
dev/codex/comet-expose-native-memory-usage
branch
from
August 24, 2026 19:09
5f4cb6c to
3e52b6b
Compare
Member
This was referenced Sep 9, 2026
This was referenced Sep 26, 2026
andygrove
added a commit
that referenced
this pull request
Sep 29, 2026
#6269) (#6419) CometTaskMemoryManager.acquireMemory logged a warning, then called TaskMemoryManager.showMemoryUsage, every time Spark granted less memory than a native pool asked for. A partial grant is how a native operator learns to spill, so a query that spills logged hundreds of them. Log the partial grant at DEBUG instead. A refusal that fails the task already says in its error what Spark granted and lists the pool's top consumers. Drop the dump rather than moving it to DEBUG. showMemoryUsage takes the TaskMemoryManager monitor. Another acquire of the same task can hold that monitor while it waits inside Spark for memory, and this thread still holds its partial grant. The task then hangs until some other task frees memory. greedy_unified can reach this on main, because it calls Spark without a lock. sunchao found the cycle while reviewing #5613. Closes #6257. Adapted for branch-1.0: CometTaskMemoryManagerSuite does not exist here, because main added it in #5408. It is added with only this fix's two tests and the helpers they use, and listed in both PR workflows. The suite's other tests on main check a NativeMemoryConsumer.getUsed override from #5408. (cherry picked from commit e1d2c11)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Resolving the sub issue 5 in #5212
Rationale for this change
What changes are included in this PR?
How are these changes tested?