-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(scanner): add option not to follow symlinks #5325
Conversation
Following symlinks does seem somewhat useful, I assume there is no option to ignore cross-device symlinks only? |
The trick is determining whether or not a symlink is cross-device without calling |
Try using |
I've tried out some stuff in a99335a; WDYT? Reasonable or too brittle? |
There's an issue with I guess one path forward is submitting a patch to |
The crate is somewhat minimalistic, so I'm uncertain if the maintainers will be receptive to such a change. |
So, given these limitations, how about we go back to the "don't follow symlinks in this case" option? Perhaps as a configurable? |
I think making it configurable is fine, unless you want to try making the timeout itself more reliable. |
02f298a
to
dbd0d87
Compare
Making the timeout itself more reliable is more challenging ( |
Finally added tests. The failures on nightly are unrelated to my changes, occur on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Settings this to false can fix hanging on symlinks to slow/inaccessible filesystems.
Still blocked on #5532 for passing the checks. |
Thanks for the contribution @lutzky! |
Never consider a symlink to be a subdirectory; this prevents hanging when the symlink points to a slow/inaccessible filesystem.
Description
Instead of using
is_dir
, which follows symlinks, usesymlink_metadata
, which doesn't.Motivation and Context
If the current directory has a symlink to a slow filesystem (e.g. an inaccessible network filesystem),
is_dir
hangs indefinitely, disregardingscan_timeout
.This should help with some instances of #312.
Screenshots (if appropriate):
n/a
How Has This Been Tested?
I've tested by running
starship timings
with network disconnected in a directory which includes a symlink to a network filesystem. Without my change it hangs, with my change it doesn't.Checklist: