-
Type:
Bug
-
Status: Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: NoFixVersionApplicable
-
Fix Version/s: 5.2.0
-
Component/s: Local watcher
-
Release Notes Summary:Less Watchers
-
Release Notes Description:
-
Epic Link:
-
Tags:
-
Sprint:nxDrive 11.2.19
-
Story Points:1
Problem
Sentry Issue: NUXEO-DRIVE-516
RuntimeError: Cannot add watch <ObservedWatch: path=/Users/manon, is_recursive=False> - it is already scheduled File "watchdog/observers/fsevents.py", line 306, in run Unhandled exception in FSEventsEmitter
To reproduce, it is as simple as adding 2 accounts with 2 local folders on the same partition.
Analysis
The upgrade to watchdog 2.1.0 showed an issue on our side: when starting an Engine, the local folder contents were watched, but also the parent folder to detect changes on the local folder itself.
The first account is starting well. But then the second account will try to watch the parent folder too, which is already watched, thus the exception.
Fix
Watching the local folder parent is is not necessary as the current watched will detect events targeting itself.
Moreover, with that behavior the app was watching huge trees for nothing. It was consuming resources and battery, and we would like to reduce such impact on the OS.
Simply remove the local parent watcher.