getChan commented on code in PR #20422:
URL: https://github.com/apache/datafusion/pull/20422#discussion_r2822568251


##########
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!("capacity {capacity} exceeds reservation size {prev}")

Review Comment:
    Nit: It might be nice to use the same error message format as try_shrink 
for consistency.
   `"Cannot free the capacity {capacity} out of allocated size {prev}"`



-- 
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]

Reply via email to