-
-
Notifications
You must be signed in to change notification settings - Fork 962
Fix race in inotify backend #678
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
Merged
+153
−39
Conversation
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
Ignore some fs.ErrNotExist errors in locations where it's safe to do so. This is what all other backends do. Also add some more details to the errors; just "no such file or directory" is not very helpful.
It's a long-standing problem that some tests intermittently fail on the CI with this, but with the new TestRace/remove_self it would be fairly consistently reproducible. Seems what would happen is that it did "fd := w.path[path]", and that this could return 0 as that path had already been removed. That would close fd 0 (stdin), fd 0 then got re-used for the next test, which would work for a bit until it didn't and you got an error. Also ignore some ErrNotExist errors. This doesn't completely fix it; it still fails on occasion. I want to rewrite the kqueue backend anyway, and it's been a problem for as long as I've been involved. So not a priority to completely fix it right now.
project-mirrors-bot-tu bot
pushed a commit
to project-mirrors/forgejo-as-gitea-fork
that referenced
this pull request
Apr 6, 2025
…tea#7473) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [github.com/fsnotify/fsnotify](https://github.com/fsnotify/fsnotify) | require | minor | `v1.8.0` -> `v1.9.0` | --- ### Release Notes <details> <summary>fsnotify/fsnotify (github.com/fsnotify/fsnotify)</summary> ### [`v1.9.0`](https://github.com/fsnotify/fsnotify/releases/tag/v1.9.0) [Compare Source](fsnotify/fsnotify@v1.8.0...v1.9.0) ##### Changes and fixes - all: make BufferedWatcher buffered again ([#&go-gitea#8203;657]) - inotify: fix race when adding/removing watches while a watched path is being deleted ([#&go-gitea#8203;678], [#&go-gitea#8203;686]) - inotify: don't send empty event if a watched path is unmounted ([#&go-gitea#8203;655]) - inotify: don't register duplicate watches when watching both a symlink and its target; previously that would get "half-added" and removing the second would panic ([#&go-gitea#8203;679]) - kqueue: fix watching relative symlinks ([#&go-gitea#8203;681]) - kqueue: correctly mark pre-existing entries when watching a link to a dir on kqueue ([#&go-gitea#8203;682]) - illumos: don't send error if changed file is deleted while processing the event ([#&go-gitea#8203;678]) [#&go-gitea#8203;657]: fsnotify/fsnotify#657 [#&go-gitea#8203;678]: fsnotify/fsnotify#678 [#&go-gitea#8203;686]: fsnotify/fsnotify#686 [#&go-gitea#8203;655]: fsnotify/fsnotify#655 [#&go-gitea#8203;681]: fsnotify/fsnotify#681 [#&go-gitea#8203;679]: fsnotify/fsnotify#679 [#&go-gitea#8203;682]: fsnotify/fsnotify#682 </details> --- ### Configuration 📅 **Schedule**: Branch creation - "* 0-3 * * *" (UTC), Automerge - "* 0-3 * * *" (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4yMjIuMSIsInVwZGF0ZWRJblZlciI6IjM5LjIyMi4xIiwidGFyZ2V0QnJhbmNoIjoiZm9yZ2VqbyIsImxhYmVscyI6WyJkZXBlbmRlbmN5LXVwZ3JhZGUiLCJ0ZXN0L25vdC1uZWVkZWQiXX0=--> Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7473 Reviewed-by: Earl Warren <[email protected]> Co-authored-by: Renovate Bot <[email protected]> Co-committed-by: Renovate Bot <[email protected]>
This was referenced Jul 30, 2025
Closed
purpleidea
added a commit
to purpleidea/mgmt
that referenced
this pull request
Sep 9, 2025
This should fix a race condition in that library. Likely fixed in: fsnotify/fsnotify#678
purpleidea
added a commit
to purpleidea/mgmt
that referenced
this pull request
Sep 9, 2025
This should fix a race condition in that library. Likely fixed in: fsnotify/fsnotify#678
This was referenced Oct 21, 2025
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.
It would access "watch.wd", but that's racy. I redid quite a bit of the inotify backend to add some new features, so regression from one of those changes (and/or would work "by accident" before).
Fixes #653
Fixes #664
Fixes #672