[Unison-hackers] fsmonitor.py & ignore paths on Linux
Jay Levitt
jay.levitt at akamai.com
Mon Jul 19 11:16:28 EDT 2010
I'm trying out the most excellent -repeat watch functionality in SVN,
syncing between a Mac and a Linux machine; the directory has about
260,000 files in it, but I'm ignoring all but 5,000. The Mac detects
changes instantly, but the Linux side has a few problems:
- At startup, it takes about five minutes of 100% CPU crunching to
populate the watcher paths - and this is five minutes on a machine with
a hybrid-SSD drive! It then takes another 10-15 minutes of seeming idle
before it starts working normally.
It looks like it's adding every single file as its own inotify_watch.
If I understand inotify correctly, you don't need to do that - all you
need to do is watch each directory in the tree, and any contained files
will also be notify. I'm guessing that doing a stat on each file (to
see if it's a directory) would be more efficient than adding each watcher.
- That's made significantly worse by the fact that it doesn't honor any
ignore paths in the unison config; this probably would be a minor
annoyance if it only had to iterate over 5K of files instead of 250K.
- Now that I think about it, fsmonitor.py on Linux (server) is assuming
that its ~/.unison directory contains the same profile as the Mac
(client). In my case, it doesn't, only because I hadn't thought to copy
it over.
- But even worse: unison obeys fsmonitor's instruction and syncs up
changed files - even if they were previously ignored. So, f'rinstance,
the server's .unison archive files are getting synced to the client.
Do you need any further info to reproduce these? I know the linux code
is especially untested. I'd offer a patch, but I don't know Python, so
that'd be more threat than offer.
Jay Levitt
More information about the Unison-hackers
mailing list