On Mon, Aug 11, 2014 at 06:01:49PM -0400, Richard Geary wrote:
> Hi Peter,
>
> This looks interesting, a daemonized fs-watching ninja has been mentioned
> on this list a long time ago. I see your Watcher class provides an
> interface to provide FS event updates - one alternative for this for nfs
> which has no inotify, and provide the fs events with a socket.
Other obvious alternatives include watchers for other operating systems
and a mock watcher for tests.
> You may have read it already, but there's a good write-up of the
> difficulties of implementing a recursive inotify here :
>
http://lwn.net/Articles/605128/
I hadn't read that article. The problem we have to solve is slightly different
to the one in the article, as we don't need to monitor every path in a tree
recursively, just the ones that are mentioned in the manifest file. The
design is intended to avoid race conditions by (e.g.) creating watches on
directories before inspecting them, as mentioned in the article. I have yet
to implement queue overflows, though, and I don't think I need to handle
renames beyond treating them as a delete/create pair.
> Also, you may want to warn if the system runs out of inotify resources -
> our default system setup here had a low inotify limit.
Right, I'll need to add more robust error handling.
Peter
--
Peter