fix(watch): skip unreadable directories instead of failing the watch - #13992
Open
Endika wants to merge 2 commits into
Open
fix(watch): skip unreadable directories instead of failing the watch#13992Endika wants to merge 2 commits into
Endika wants to merge 2 commits into
Conversation
Signed-off-by: Endika Iglesias <endika2@gmail.com>
Endika
force-pushed
the
fix/watch-unreadable-directory
branch
from
August 1, 2026 07:47
eacf003 to
e72f36a
Compare
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
CI runs the tests as root, where the unreadable-directory test is always skipped. Extract the WalkDir callbacks and inject the watch registration so a synthetic permission error can drive those branches instead. Signed-off-by: Endika Iglesias <endika2@gmail.com>
Endika
force-pushed
the
fix/watch-unreadable-directory
branch
from
August 1, 2026 13:12
a82f4ea to
7900d4b
Compare
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.
What I did
compose watchregisters an inotify watch on every directory below the watchedpath. A single directory the current user cannot read makes registration fail
with
permission denied, and the whole watch fails to start — so nothing getswatched at all.
Permission errors are now treated the way the surrounding code already treats
os.IsNotExist: log at debug level andfilepath.SkipDir. Losing visibilityinto one subtree should not cost the entire watch.
Includes a regression test in
watcher_naive_test.go, which fails without thechange.
Related issue
closes #13750