_MultiPathWatcher unnecessarily watches parent folder of given path #7467
Labels
feature:cli
Related to the command line interface
good first issue
Good for newcomers
priority:P3
status:confirmed
Bug has been confirmed by the Streamlit team
type:bug
Something isn't working
Checklist
Summary
When starting streamlit in a standard way, it unexpectedly printed
OSError: [Errno 24] inotify instance limit reached
message, even though high number of files were not around._MultiPathWatcher
instreamlit/watcher/event_based_path_watcher.py
watches parent directories of a given path, thereby possibly including unrelated directories with files of no interest.I believe watching for the requested directory is enough, without watching for it's parent.
Reproducible Code Example
Steps To Reproduce
code
, or include something fromcode
, soLocalSourcesWatcher
will watch itdata
Expected Behavior
Only
code
folder is watched for changes, which has only 10-100 code files.Current Behavior
The parent of
code
: themain
folder is watched for changes. With this,data
folder is also watched, and as it contains 10000s of files, inotify is over the limits, and evencode
will not watched in reality.Increasing the inotify limit or choosing poll policy are workarounds, but that is not the proper solution.
Is this a regression?
Debug info
Additional Information
No response
The text was updated successfully, but these errors were encountered: