[SPARK-58975][CORE] Add failure messages to MemoryPool require checks - #58251
Open
uros-b wants to merge 3 commits into
Open
[SPARK-58975][CORE] Add failure messages to MemoryPool require checks#58251uros-b wants to merge 3 commits into
uros-b wants to merge 3 commits into
Conversation
uros-b
commented
Aug 24, 2026
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.
What changes were proposed in this pull request?
MemoryPool.incrementPoolSizeanddecrementPoolSizeguard their pool-size accounting invariants with fourrequire(...)checks that carry no failure message. When one fails, the thrownIllegalArgumentExceptionreads onlyrequirement failed, with no indication of which invariant was violated or the values involved.This adds descriptive messages to those four checks, interpolating the offending values, for example:
The sibling
MemoryManageralready attaches messages to all of itsrequirecalls; this bringsMemoryPoolin line.Why are the changes needed?
These checks guard internal memory-bookkeeping invariants. A bare
requirement failedis hard to act on when one trips; including the invariant and the actualdelta/ pool size / used-memory values makes such failures diagnosable.Does this PR introduce any user-facing change?
No.
MemoryPoolisprivate[memory]; this only changes the message of anIllegalArgumentExceptionthrown on an internal invariant violation.How was this patch tested?
Existing tests. The change only adds messages to existing
requirechecks; the conditions themselves are unchanged.Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Opus 4.8)