From 09f087f0eba15cc7e87bea0869d32b147fd5bc4b Mon Sep 17 00:00:00 2001 From: Eren Avsarogullari Date: Sun, 15 Feb 2026 13:12:52 -0800 Subject: [PATCH] Set expected runtime config in error message when the used disk space during the spilling process has exceeded the allocation limit --- datafusion/core/tests/memory_limit/mod.rs | 8 ++++---- datafusion/execution/src/disk_manager.rs | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/datafusion/core/tests/memory_limit/mod.rs b/datafusion/core/tests/memory_limit/mod.rs index c28d23ba0602b..0171fb49e3cb6 100644 --- a/datafusion/core/tests/memory_limit/mod.rs +++ b/datafusion/core/tests/memory_limit/mod.rs @@ -602,10 +602,10 @@ async fn test_disk_spill_limit_reached() -> Result<()> { .await .unwrap(); - let err = df.collect().await.unwrap_err(); - assert_contains!( - err.to_string(), - "The used disk space during the spilling process has exceeded the allowable limit" + let error_message = df.collect().await.unwrap_err().to_string(); + assert!( + error_message.contains("The used disk space during the spilling process has exceeded the allowable limit") && + error_message.contains("datafusion.runtime.max_temp_directory_size"), ); Ok(()) diff --git a/datafusion/execution/src/disk_manager.rs b/datafusion/execution/src/disk_manager.rs index d878fdcf66a4c..1a14bd239a61a 100644 --- a/datafusion/execution/src/disk_manager.rs +++ b/datafusion/execution/src/disk_manager.rs @@ -420,7 +420,8 @@ impl RefCountedTempFile { let global_disk_usage = self.disk_manager.used_disk_space.load(Ordering::Relaxed); if global_disk_usage > self.disk_manager.max_temp_directory_size { return resources_err!( - "The used disk space during the spilling process has exceeded the allowable limit of {}. Try increasing the `max_temp_directory_size` in the disk manager configuration.", + "The used disk space during the spilling process has exceeded the allowable limit of {}. \ + Please try increasing the config: `datafusion.runtime.max_temp_directory_size`.", human_readable_size(self.disk_manager.max_temp_directory_size as usize) ); }