-
Notifications
You must be signed in to change notification settings - Fork 125
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
What is the limit on the number of directories that may be watched with a recursive watcher? #137
Comments
Hey @veqryn !
It depends on the number of "watch descriptors" allowed by your kernel.
Yes, it is. You can tweak the number with
Unfortunately, notify doesn't have built-in file filters. See #79 for more details. |
Thanks. Is there a way to tell, within this library or within golang, when you've run out of watch descriptors? |
At this moment there is no clean solution for detecting watch descriptors overflow in notify. The simplest one is to just return an error when creating watchers. This was implemented but, due to some resource leakage issues, we decided that it won't be merged. If you need this behavior, you can fork the project and apply this path. |
A watch descriptor is needed for each directory on linux, correct? |
Yes and no. The solution we were also considering is to handle the error gracefully - fallback to polling on fstat, so the events keep coming. Either solution (an error chan or graceful handling) would require an extended API, which is something we did not agree yet on and are no working on currently. Unfortunately. |
K, thanks for the insight. I'll close this now. |
I saw two unresolved issues referencing the fact that this package can stop watching directories if there are too many, but without throwing an error or alerting to that fact.
Since that is the case, how many directories can be watched on a linux system?
If it is specific to each server, how do I figure out this number?
Also, is there a way to exclude certain directories from a recursive watch?
The text was updated successfully, but these errors were encountered: