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


##########
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:
   Can we  get an `Err` instead of `panic!` ?



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