I had started a fresh repo to test out the watch command again on OSX and noticed that it's borked, I'm not sure when it was broken.

The snippet of the log message and command is

$ git annex watch --foreground -d -v
watch . read: git ["--git-dir=/Users/jtang/sandbox/atest/.git","--work-tree=/Users/jtang/sandbox/atest","show-ref","git-annex"] 
read: git ["--git-dir=/Users/jtang/sandbox/atest/.git","--work-tree=/Users/jtang/sandbox/atest","show-ref","--hash","refs/heads/git-annex"] 
read: git ["--git-dir=/Users/jtang/sandbox/atest/.git","--work-tree=/Users/jtang/sandbox/atest","log","refs/heads/git-annex..6702e5361146450800ae5af0b63e97bd9c55d70b","--oneline","-n1"] 
chat: git ["--git-dir=/Users/jtang/sandbox/atest/.git","--work-tree=/Users/jtang/sandbox/atest","cat-file","--batch"] 
(scanning...) call: git ["--git-dir=/Users/jtan

I had run git-annex with a new repo with just doing a git init and git annex init, I just threw in one or two small text files to see if it was working. It just hangs and does nothing. I had also tried it out on one of my bigger repos and it does the same thing it just hangs at (scanning...) There isn't much to go on, I wonder if it's hitting the Issue on OSX with some system limits or if its just a thread/fork issue on OSX.

It still hangs on the small repo even if I do

$ sudo sysctl -w kern.maxfilesperproc=400000
$ ulimit -n 2000

Also, just in case if you need it still (on a clean OSX 10.7 system)

$ ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
file size               (blocks, -f) unlimited
max locked memory       (kbytes, -l) unlimited
max memory size         (kbytes, -m) unlimited
open files                      (-n) 256
pipe size            (512 bytes, -p) 1
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) 709
virtual memory          (kbytes, -v) unlimited

Please close or merge this report if it's a duplicate.

I've fixed this, it works in my (so far limited) tests. done --Joey

I see this too, on OSX, and it's another one of the hangs with the threaded runtime I've been battling recently. Removing -threaded from the Makefile or git-annex.cabal (whichever you're using) makes it work.

Seems likely this one is specific to my kqueue code. Indeed, I see it entering the kqueue code and then hanging, when it should be noticing changes. Interestingly, all threads seem to get blocked, too.

AHA! I had the FFI functions marked unsafe. Marking safe seems to fix that. I need to go re-read up on the FFI and when it's safe to mark functions threadsafe.

Thanks as always for the OSX eyes Jimmy!

Comment by http://joeyh.name/ Fri Jul 20 18:17:04 2012
Glad that I can help ;) Alas if it weren't for the learning curve of haskell, I'd fix it myself.
Comments on this page are closed.