wiedld commented on code in PR #11665:
URL: https://github.com/apache/datafusion/pull/11665#discussion_r1693480102


##########
datafusion/execution/src/memory_pool/pool.rs:
##########
@@ -231,6 +235,11 @@ impl MemoryPool for FairSpillPool {
     }
 }
 
+/// Constructs a resources error based upon the individual 
[`MemoryReservation`].
+///
+/// The error references the `bytes already allocated` for the reservation,
+/// and not the total within the collective [`MemoryPool`],
+/// nor the total across multiple reservations with the same 
[`MemoryConsumer`].
 #[inline(always)]
 fn insufficient_capacity_err(

Review Comment:
   This^^ suggestion is because this error message is inherently about only the 
reservation itself. Each reservation can request bytes from the pool -- but the 
pool itself only incr/decrements totals for the pool. It does **NOT** track 
each reservation, nor if multiple reservations have the same consumer.
   
   As a result, the simplest solution is to: (a) update this error message, and 
(b) continue to rely upon each reservation to resize itself to upon drop ([as 
it 
does](https://github.com/apache/datafusion/blob/01dc3f9766e1e36ef9864effdb1a7c89d138a982/datafusion/execution/src/memory_pool/mod.rs#L307-L310)).



-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to