Comment 5 for bug 872894

Revision history for this message
Facundo Batista (facundo) wrote : Re: Unhandled INotify events break syncdaemon file watching

Yes!

Proposed patch (needs tests):

=== modified file 'ubuntuone/platform/linux/filesystem_notifications.py'
--- ubuntuone/platform/linux/filesystem_notifications.py 2011-10-18 13:51:26 +0000
+++ ubuntuone/platform/linux/filesystem_notifications.py 2011-12-19 11:23:11 +0000
@@ -405,6 +405,7 @@

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

         class MyReader(abstract.FileDescriptor):
             """Chain between inotify and twisted."""
@@ -418,7 +419,10 @@
             def doRead(self):
                 """Called when twisted says there's something to read."""
                 notifier.read_events()
- notifier.process_events()
+ try:
+ notifier.process_events()
+ except Exception, e:
+ _logger.exception("Error while processing events: %r", e)

         reader = MyReader()
         reactor.addReader(reader)