hareshkh commented on code in PR #20422:
URL: https://github.com/apache/datafusion/pull/20422#discussion_r2838655483
##########
datafusion/execution/src/memory_pool/mod.rs:
##########
@@ -387,7 +387,9 @@ impl MemoryReservation {
atomic::Ordering::Relaxed,
|prev| prev.checked_sub(capacity),
)
- .expect("capacity exceeds reservation size");
+ .unwrap_or_else(|prev| {
+ panic!("Cannot free the capacity {capacity} out of allocated
size {prev}")
Review Comment:
The docstring says that `shrink` panics while `try_shrink` returns an Err -
which also seems correct. `try_shrink` below returns an internal_datafusion_err
while this one panics. Does this behaviour feel incorrect?
--
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]