Improve error message for when adding inotify watcher fails
authorMichael Hanselmann <hansmi@google.com>
Mon, 10 Dec 2012 13:34:15 +0000 (14:34 +0100)
committerMichael Hanselmann <hansmi@google.com>
Mon, 10 Dec 2012 14:23:30 +0000 (15:23 +0100)
Explicitely mention the fs.inotify.max_user_watches sysctl value.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

lib/asyncnotifier.py

index 37a2fcb..f4b0815 100644 (file)
@@ -109,7 +109,9 @@ class FileEventHandlerBase(pyinotify.ProcessEvent):
 
     ret = result.get(filename, -1)
     if ret <= 0:
-      raise errors.InotifyError("Could not add inotify watcher (%s)" % ret)
+      raise errors.InotifyError("Could not add inotify watcher (error code %s);"
+                                " increasing fs.inotify.max_user_watches sysctl"
+                                " might be necessary" % ret)
 
     return result[filename]