mod-audio / mod-sdk

SDK to implement the MOD gui interface
GNU General Public License v3.0
34 stars 16 forks source link

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

Open vallsv opened 4 years ago

vallsv commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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