GNOME Bugzilla – Bug 169262
Exception on Inotify Event
Last modified: 2005-03-11 18:44:08 UTC
Version details: CVS 2005/03/04 20:50 America/New_York Distribution/Version: Fedora Rawhide Latest Beagle and Inotify 0.20, getting this when I cause an inotify event (touch a file) WARN: Exception caught while executing Beagle.Daemon.FileSystemQueryable.FileSystemQueryable:Void StartWorker() WARN: System.IO.IOException: /home/skadz/Downloads/mp3_256Kbps_complete in <0x001f5> Beagle.Util.Inotify:Watch (string,Beagle.Util.Inotify/EventType,Beagle.Util.Inotify/EventType) in <0x0000f> Beagle.Util.Inotify:Watch (string,Beagle.Util.Inotify/EventType) in <0x00049> Beagle.Daemon.FileSystemQueryable.InotifyBackend:WatchFiles (string,object) in <0x001af> Beagle.Daemon.FileSystemQueryable.FileSystemModel:ScanAll () in <0x0000d> Beagle.Daemon.FileSystemQueryable.FileSystemQueryable:OnModelNeedsScan (Beagle.Daemon.FileSystemQueryable.FileSystemModel) in <0x0003f> (wrapper delegate-invoke) System.MulticastDelegate:invoke_void_FileSystemModel (Beagle.Daemon.FileSystemQueryable.FileSystemModel) in <0x00341> Beagle.Daemon.FileSystemQueryable.FileSystemModel:AddRoot (string) in <0x00136> Beagle.Daemon.FileSystemQueryable.FileSystemQueryable:StartWorker () in <0x00037> (wrapper delegate-invoke) System.MulticastDelegate:invoke_void () in <0x00018> Beagle.Util.ExceptionHandlingThread:ThreadStarted ()
Robert: since you are looking at that code now, any thoughts?
This isn't very helpful, or I cannot read C# traces. But, why is touching a file causing Watch() to be called? Could you of patched the kernel wrong? Sure that the patch applied without problem?
skadz, does Util/inotify-test work? What about the test program in inotify-utils?
My guess is that there's a race here: the file system backend is in the process of starting up and adding watches to everything, and one thing that is about to be watched is deleted. Inotify.Watch() looks to make sure that the file exists and throws an IOException if not.
That is it. Cunning as ever, Shaw. We should not through an IO Exception. We cannot expect the filesystem to be consistent. I'll change the exception to a simple return. By the way, I woke up this morning and it seemed to me, that every night turns out to be, a little more like Bukowski.
Actually, we should probably throw the exception, but catch it in the callers. Sigh, more work.
Actually, we only need to do this in the FileSystemBackend. The rest of the calls to Watch() do consider it a critical problem when the request file does not exist.
Created attachment 38568 [details] [review] The fix.
Fix commited to "CVS"