Closed nsoblath closed 9 years ago
In testing on teselecta I see the following:
2015/06/08 12:04:47 [watcher dir event] "/home/nsoblath/go/src/github.com/project8/hornet/build-dftesting/run0": 0x8000 == IN_IGNORED
2015/06/08 12:04:47 [watcher dir event] "/home/nsoblath/go/src/github.com/project8/hornet/build-dftesting/run0": 0x40000200 == IN_DELETE|IN_ISDIR
2015/06/08 12:04:47 [watcher] removing watch on /home/nsoblath/go/src/github.com/project8/hornet/build-dftesting/run0...
2015/06/08 12:04:47 [watcher] can't remove file watch on /home/nsoblath/go/src/github.com/project8/hornet/build-dftesting/run0 [inotify_rm_watch: invalid argument]
2015/06/08 12:04:47 [watcher] can't remove dir watch on /home/nsoblath/go/src/github.com/project8/hornet/build-dftesting/run0 [inotify_rm_watch: invalid argument]
2015/06/08 12:04:47 [watcher file event] "/home/nsoblath/go/src/github.com/project8/hornet/build-dftesting/run0": 0x8000 == IN_IGNORED
2015/06/08 12:04:47 [scheduler] sending <run0> to the classifier
2015/06/08 12:04:47 [classifier] file </home/nsoblath/go/src/github.com/project8/hornet/build-dftesting/run0> does not exist
2015/06/08 12:04:47 [scheduler] error received from the classifier:
[classifier] file </home/nsoblath/go/src/github.com/project8/hornet/build-dftesting/run0> does not exist
Reading through the inotify man page (), I found this comment regarding the bits that can be set in the return from an inotify read
call:
IN_IGNORED
Watch was removed explicitly (inotify_rm_watch(2)) or automatically (file was deleted, or file system was unmounted).
This implies that the watches on directories that are deleted are automatically removed. Therefore we don't have to remove them ourselves. It further explains I was seeing IN_IGNORED events when directories were deleted. Those were the watches being removed.
Further testing shows that anytime a directory being watched is deleted, or moved, the remove-watch call is invalid: inotify_rm_watch: invalid argument
. Therefore the course of action is to stop acting on IN_DELETE and IN_MOVED_FROM events.
Fixed in commit 0de83b5
Oddities:
IN_DELETE|IN_ISDIR
), there's an "invalid argument" errorThis is from testing on ignatius