-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
fix: share inotify fd across watchers #26200
Conversation
event.paths.iter().any(|event_path| { | ||
same_file::is_same_file(event_path, path).unwrap_or(false) | ||
|| starts_with_canonicalized(event_path, path) | ||
}) |
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.
Can we be smarter here? Iterating over all paths specified for each watcher can be costly. Maybe a hash set would work better here to try and match file path directly?
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.
Two watchers can be watching the same file/directory so HashSet won't work.
That would work but won't be fast for most cases that require high file watchers (recursive) because we need to fallback when paths are inside directory or symlinked.
Fixes #26104
Fixes #26071
Fixes #17757