Comment 4 for bug 872894

Revision history for this message
Roman Yepishev (rye) wrote : Re: Unhandled INotify events break syncdaemon file watching

Facundo, is it correct that this code has no exception handler:

def _hook_inotify_to_twisted(self, wm, notifier):
    """This will hook inotify to twisted."""

    class MyReader(abstract.FileDescriptor):
        """Chain between inotify and twisted."""
        # will never pass a fd to write, pylint: disable-msg=W0223

        def fileno(self):
            """Returns the fileno to select()."""
            # pylint: disable-msg=W0212
            return wm._fd

        def doRead(self):
            """Called when twisted says there's something to read."""
            notifier.read_events()
            notifier.process_events()

    reader = MyReader()
    reactor.addReader(reader)
    return reader

In case when process__events() fails, then all subsequent INotify events are not processed.