diff options
author | Joey Hess <joey@kitenet.net> | 2012-06-21 01:07:37 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-06-21 01:07:37 -0400 |
commit | 9f1a29762b074e668d3d6e7bea273c1f14f69b90 (patch) | |
tree | 204729e49d7e431046d3a6568182b7707840c8ca | |
parent | 019d0735052d2688dc0bdeb6ba51c46b77303aaf (diff) |
blog for the day
-rw-r--r-- | doc/design/assistant/blog/day_14__kqueue_kqueue_kqueue.mdwn | 23 | ||||
-rw-r--r-- | doc/design/assistant/inotify.mdwn | 5 |
2 files changed, 23 insertions, 5 deletions
diff --git a/doc/design/assistant/blog/day_14__kqueue_kqueue_kqueue.mdwn b/doc/design/assistant/blog/day_14__kqueue_kqueue_kqueue.mdwn new file mode 100644 index 000000000..d7dab3611 --- /dev/null +++ b/doc/design/assistant/blog/day_14__kqueue_kqueue_kqueue.mdwn @@ -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]]. diff --git a/doc/design/assistant/inotify.mdwn b/doc/design/assistant/inotify.mdwn index fb9ed592b..bea21bff7 100644 --- a/doc/design/assistant/inotify.mdwn +++ b/doc/design/assistant/inotify.mdwn @@ -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. |