-
Notifications
You must be signed in to change notification settings - Fork 129
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
recursive watch on large directory exhausting inotifywatch does not cause error #109
Comments
would there be any support for an fanotify patch? It doesn't include some of the granularity of inotify but it also doesn't suffer from this issue |
@adamjacobmuller Thanks for the report. The ideal solution would be here to either fallback to polling or keep retrying setting the watch with some backoff. Currently notify does not have an API to return watch errors (with a channel of some sort), as the philosophy was "if notify is not able to recover from watch error then user also won't be able to". After working for a while with such approach I understood it is limiting and something that I'd definitely want to change by introducing new API (backward-compatible one). For now there is not easy workaround for that.
I'm not sure how it could work out, fanotify does not support |
Just wanted to bump this issue as well. I was scratching my head for a few hours on why inotify events were not being seen by this lib and it turned out I too ran out of watches, however I was out of watches before it was initiated. On debian:
Bumping the default 8192 to 16384 in I'm going to see if there's a way we can return watch errors on another channel as @rjeczalik mentioned. |
Also for the record, if I did not watch a directory recursively (i.e. no |
Providing an update on this:
It seems the situation has changed, as I discovered in https://gitlab.gnome.org/GNOME/localsearch/-/issues/109 :
This is corroborated by @infectormp's report in syncthing/syncthing#5755 |
Trivial repro but including it anyway.
`
package main
import (
"log"
)
func main() {
c := make(chan notify.EventInfo, 1)
}
`
/home/adam/ is a directory with a lot (probably a few million) files.
In this case, at some point during setting up the notify.Watch it runs out of user events but err is not set.
The text was updated successfully, but these errors were encountered: