From 26a7404aa0e6638ef88cfc3b1ce5b097a8ba6863 Mon Sep 17 00:00:00 2001 From: hieuit095 Date: Thu, 2 Apr 2026 21:22:35 +0700 Subject: [PATCH] Prevent panic on repeated EINTR errors by gracefully skipping problematic directories When scanning filesystems that generate many EINTR errors (e.g., network filesystems like NFS, FUSE, or containers with certain volume mounts), the previous code would panic after 999 interrupts. This replaces the panic with a graceful skip: the problematic directory is omitted from results and scanning continues. Users see a warning message on stderr instead of a crash. Fixes: repeated EINTR errors causing dust to abort on network filesystems --- src/dir_walker.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/dir_walker.rs b/src/dir_walker.rs index c56baa85..e40f0680 100644 --- a/src/dir_walker.rs +++ b/src/dir_walker.rs @@ -304,7 +304,11 @@ fn handle_error_and_retry(failed: &Error, dir: &Path, walk_data: &WalkData) -> b // This does happen on some systems. It was set to 3 but sometimes dust runs would exceed this // However, if there is no limit this results in infinite retrys and dust never finishes if editable_error.interrupted_error > 999 { - panic!("Multiple Interrupted Errors occurred while scanning filesystem. Aborting"); + eprintln!( + "Too many Interrupted Errors occurred while scanning filesystem, skipping: {}", + dir.to_string_lossy() + ); + return false; } else { return true; }