blog for the day
This commit is contained in:
parent
019d073505
commit
9f1a29762b
2 changed files with 23 additions and 5 deletions
23
doc/design/assistant/blog/day_14__kqueue_kqueue_kqueue.mdwn
Normal file
23
doc/design/assistant/blog/day_14__kqueue_kqueue_kqueue.mdwn
Normal file
|
@ -0,0 +1,23 @@
|
|||
... I'm getting tired of kqueue.
|
||||
|
||||
But the end of the tunnel is in sight. Today I made git-annex handle files
|
||||
that are still open for write after a kqueue creation event is received.
|
||||
Unlike with inotify, which has a new event each time a file is closed,
|
||||
kqueue only gets one event when a file is first created, and so git-annex
|
||||
needs to retry adding files until there are no writers left.
|
||||
|
||||
Eventually I found an elegant way to do that. The committer thread already
|
||||
wakes up every second as long as there's a pending change to commit. So for
|
||||
adds that need to be retried, it can just push them back onto the change
|
||||
queue, and the committer thread will wait one second and retry the add. One
|
||||
second might be too frequent to check, but it will do for now.
|
||||
|
||||
This means that `git annex watch` should now be usable on OSX, FreeBSD, and
|
||||
NetBSD! (It'll also work on Debian kFreeBSD once [lsof is ported to it](http://bugs.debian.org/589103).)
|
||||
I've meged kqueue support to `master`.
|
||||
|
||||
I also think I've squashed the empty commits that were sometimes made.
|
||||
|
||||
Incidentally, I'm 50% through my first month, and finishing [[inotify]]
|
||||
was the first half of my roadmap for this month. Seem to be right on
|
||||
schedule.. Now I need to start thinking about [[syncing]].
|
|
@ -13,11 +13,6 @@ There is a `watch` branch in git that adds the command.
|
|||
|
||||
* When you `git annex unlock` a file, it will immediately be re-locked.
|
||||
|
||||
* With kqueue, if a file is created and still has a writer, it'll
|
||||
give up adding it, and it will never get added. This is because kqueue
|
||||
cannot track file closes. Need to go back and check these files every
|
||||
second or something.
|
||||
|
||||
* Kqueue has to open every directory it watches, so too many directories
|
||||
will run it out of the max number of open files (typically 1024), and fail.
|
||||
I may need to fork off multiple watcher processes to handle this.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue