Skip to content

Commit 476c200

Browse files
refactor: Set expected runtime config in error message when the used disk space during the spilling process has exceeded the allocation limit (#20375)
## Which issue does this PR close? - Closes #20373. ## Rationale for this change Minor refactoring on error message by exposing required config name for the end user. This is follow-up PR to both PR: #20226 and #20372 by runtime config: `datafusion.runtime.max_temp_directory_size`. ## What changes are included in this PR? **Current:** ``` 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. ``` **New:** ``` 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`.", ``` ## Are these changes tested? Yes, legacy UT case has been updated by covering expected config name. ## Are there any user-facing changes? Yes, error message has been updated which is exposed to end-users.
1 parent 657887d commit 476c200

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

datafusion/core/tests/memory_limit/mod.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -602,11 +602,16 @@ async fn test_disk_spill_limit_reached() -> Result<()> {
602602
.await
603603
.unwrap();
604604

605-
let err = df.collect().await.unwrap_err();
606-
assert_contains!(
607-
err.to_string(),
608-
"The used disk space during the spilling process has exceeded the allowable limit"
609-
);
605+
let error_message = df.collect().await.unwrap_err().to_string();
606+
for expected in [
607+
"The used disk space during the spilling process has exceeded the allowable limit",
608+
"datafusion.runtime.max_temp_directory_size",
609+
] {
610+
assert!(
611+
error_message.contains(expected),
612+
"'{expected}' is not contained by '{error_message}'"
613+
);
614+
}
610615

611616
Ok(())
612617
}

datafusion/execution/src/disk_manager.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,8 @@ impl RefCountedTempFile {
420420
let global_disk_usage = self.disk_manager.used_disk_space.load(Ordering::Relaxed);
421421
if global_disk_usage > self.disk_manager.max_temp_directory_size {
422422
return resources_err!(
423-
"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.",
423+
"The used disk space during the spilling process has exceeded the allowable limit of {}. \
424+
Please try increasing the config: `datafusion.runtime.max_temp_directory_size`.",
424425
human_readable_size(self.disk_manager.max_temp_directory_size as usize)
425426
);
426427
}

0 commit comments

Comments
 (0)