Bukhtawar commented on code in PR #22246:
URL: https://github.com/apache/datafusion/pull/22246#discussion_r3253397744


##########
datafusion/execution/src/disk_manager.rs:
##########
@@ -796,4 +801,78 @@ mod tests {
 
         Ok(())
     }
+
+    #[test]
+    fn test_dynamic_limit_adjustment_through_shared_ref() -> Result<()> {
+        // Verify that set_max_temp_directory_size works through &self (not 
&mut self).
+        // This is the key behavioral change: the limit can be adjusted at 
runtime
+        // without exclusive access, enabling dynamic resize while queries are 
running.
+        let dm = DiskManager::builder()
+            .with_max_temp_directory_size(1024)
+            .build()?;
+        let dm = Arc::new(dm);
+
+        assert_eq!(dm.max_temp_directory_size(), 1024);
+
+        // Adjust through shared reference (simulates concurrent access via 
Arc)
+        dm.set_max_temp_directory_size(2048)?;
+        assert_eq!(dm.max_temp_directory_size(), 2048);
+
+        // Can also decrease
+        dm.set_max_temp_directory_size(512)?;

Review Comment:
   Added tests, thanks for pointing this out



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