uros-b opened a new pull request, #58251: URL: https://github.com/apache/spark/pull/58251
### What changes were proposed in this pull request? `MemoryPool.incrementPoolSize` and `decrementPoolSize` guard their pool-size accounting invariants with four `require(...)` checks that carry no failure message. When one fails, the thrown `IllegalArgumentException` reads only `requirement 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: ```scala require(delta >= 0, s"cannot increment the pool size by a negative amount: $delta") ``` The sibling `MemoryManager` already attaches messages to all of its `require` calls; this brings `MemoryPool` in line. ### Why are the changes needed? These checks guard internal memory-bookkeeping invariants. A bare `requirement failed` is hard to act on when one trips; including the invariant and the actual `delta` / pool size / used-memory values makes such failures diagnosable. ### Does this PR introduce _any_ user-facing change? No. `MemoryPool` is `private[memory]`; this only changes the message of an `IllegalArgumentException` thrown on an internal invariant violation. ### How was this patch tested? Existing tests. The change only adds messages to existing `require` checks; the conditions themselves are unchanged. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Code (Opus 4.8) -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
