Skip to content
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

Cannot initialize new instance of inotify, Errno=Too many open files (EMFILE) #15

Open
vallsv opened this issue Nov 30, 2019 · 2 comments

Comments

@vallsv
Copy link
Contributor

vallsv commented Nov 30, 2019

Hi,

Here is what i often reach without doing much things:

Cannot initialize new instance of inotify, Errno=Too many open files (EMFILE)

I mitigate the problem this way:

 class BundleMonitorWebsocket(websocket.WebSocketHandler):
     def open(self):
-        self.monitor = BundleMonitor(self.notify)
+        try:
+            self.monitor = BundleMonitor(self.notify)
+        except Exception as e:
+            print(e)
+            self.monitor = None

     def on_message(self, bundle):
         self.monitor.monitor(bundle)

     def on_close(self):
-        self.monitor.clear()
+        if self.monitor:
+            self.monitor.clear()

But i guess things are broken anyway.

@vallsv
Copy link
Contributor Author

vallsv commented Nov 30, 2019

Here is the traceback

Traceback (most recent call last):
  File "/home/ordinateur/Software/miniconda3/envs/moddevices/lib/python3.5/site-packages/tornado/websocket.py", line 546, in _run_callback
    result = callback(*args, **kwargs)
  File "/home/ordinateur/Software/miniconda3/envs/moddevices/lib/python3.5/site-packages/modsdk/webserver.py", line 724, in open
    self.monitor = BundleMonitor(self.notify)
  File "/home/ordinateur/Software/miniconda3/envs/moddevices/lib/python3.5/site-packages/modsdk/bundlemonitor.py", line 31, in __init__
    self.wm = pyinotify.WatchManager()
  File "/home/ordinateur/Software/miniconda3/envs/moddevices/lib/python3.5/site-packages/pyinotify.py", line 1764, in __init__
    raise OSError(err % self._inotify_wrapper.str_errno())
OSError: Cannot initialize new instance of inotify, Errno=Too many open files (EMFILE)

@vallsv
Copy link
Contributor Author

vallsv commented Nov 30, 2019

I think it was because lilv was not able to load my plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant