Uploaded image for project: 'Nuxeo Drive '
  1. Nuxeo Drive
  2. NXDRIVE-2633

Do not watch the local folder parent

    Details

    • 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:
      Hide

      When starting the application, the local folder contents were watched, but also the parent folder too to detect changes on the local folder itself.

      Thanks to the recent `watchdog` upgrade, watching the local folder parent is no more necessary as the current watched will detect events targeting itself.
      Moreover, with the old behavior the application was watching huge trees for nothing. It was consuming resources and battery, and we would like to reduce such impact on the OS.

      Show
      When starting the application, the local folder contents were watched, but also the parent folder too to detect changes on the local folder itself. Thanks to the recent `watchdog` upgrade, watching the local folder parent is no more necessary as the current watched will detect events targeting itself. Moreover, with the old behavior the application was watching huge trees for nothing. It was consuming resources and battery, and we would like to reduce such impact on the OS.
    • Sprint:
      nxDrive 11.2.19
    • Story Points:
      1

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 30 minutes
                  30m

                    PagerDuty

                    Error rendering 'com.pagerduty.jira-server-plugin:PagerDuty'. Please contact your Jira administrators.