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

Running the tests under Linux causes Watchdog to raise "OSError: inotify instance limit reached"

    XMLWordPrintable

    Details

      Description

      Running the test suite under Linux with nosetests -v -x 2>&1 | tee /tmp/logs we get:

      ======================================================================
      ERROR: test_synchronization_loop (nxdrive.tests.test_integration_synchronization.TestIntegrationSynchronization)
      ----------------------------------------------------------------------
      Traceback (most recent call last):
        File "/home/ataillefer/sources/nuxeo/addons/nuxeo-drive/nuxeo-drive-client/nxdrive/tests/test_integration_synchronization.py", line 418, in test_synchronization_loop
          syn.loop(delay=0, max_loops=3)
        File "/home/ataillefer/sources/nuxeo/addons/nuxeo-drive/nuxeo-drive-client/nxdrive/synchronizer.py", line 1466, in loop
          max_sync_step=max_sync_step)
        File "/home/ataillefer/sources/nuxeo/addons/nuxeo-drive/nuxeo-drive-client/nxdrive/synchronizer.py", line 1708, in update_synchronize_server
          self.setup_local_watchdog(server_binding)
        File "/home/ataillefer/sources/nuxeo/addons/nuxeo-drive/nuxeo-drive-client/nxdrive/synchronizer.py", line 1968, in setup_local_watchdog
          recursive=True)
        File "/usr/local/lib/python2.7/dist-packages/watchdog/observers/api.py", line 324, in schedule
          timeout=self.timeout)
        File "/usr/local/lib/python2.7/dist-packages/watchdog/observers/inotify.py", line 118, in __init__
          watch.is_recursive)
        File "/usr/local/lib/python2.7/dist-packages/watchdog/observers/inotify_buffer.py", line 61, in __init__
          self._inotify = Inotify(path, recursive)
        File "/usr/local/lib/python2.7/dist-packages/watchdog/observers/inotify_c.py", line 165, in __init__
          Inotify._raise_error()
        File "/usr/local/lib/python2.7/dist-packages/watchdog/observers/inotify_c.py", line 391, in _raise_error
          raise OSError("inotify instance limit reached")
      OSError: inotify instance limit reached
      

      A first workaround is to increase /proc/sys/fs/inotify/max_user_instances as a prerequisite to Drive installation under Linux:

      # increase inotify file watch limit
      ofile=/proc/sys/fs/inotify/max_user_instances
      sudo sh -c "echo 8192 > $ofile"
      cat $ofile
      

      Another workaround is to catch the exception and fall back to local scan.

      I guess the true solution would be to understand why the inotify user instances are not closed and handle it.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: