fix: prevent panic on repeated EINTR errors during filesystem scanning#568
Open
hieuit095 wants to merge 1 commit intobootandy:masterfrom
Open
fix: prevent panic on repeated EINTR errors during filesystem scanning#568hieuit095 wants to merge 1 commit intobootandy:masterfrom
hieuit095 wants to merge 1 commit intobootandy:masterfrom
Conversation
…atic 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When dust scans filesystems that return many EINTR errors (e.g., network filesystems like NFS or FUSE-based mounts), the previous code called panic after 999 consecutive interrupts, crashing the program. Replaced the panic with a warning message on stderr and a graceful skip of the problematic directory, allowing the scan to continue with remaining accessible paths.
Changes: src/dir_walker.rs - in handle_error_and_retry(), panic replaced with eprintln warning and return false when interrupted_error exceeds 999.
All 29 unit tests and 28 integration tests pass.