git-annex/Assistant/Threads
Joey Hess 31cbde8190 assistant: Fix bug that could cause direct mode files to be unstaged from git.
My test case for this bug is to have the assistant running and syncing to
a remote, and create a file in the annex. Then at the command line run
git annex drop. The assistant sees that the file is gone, sees it's a wanted
file, and downloads it from the remote.

With a directory special remote and a small file, I was seeing around 1
time in 3, a race where the file got unstaged from git after it got
downloaded.

Looking at what direct mode content managing code does in this case, it
deletes the symlink, and then adds the file content back. It would be
possible, sometimes, to avoid removing the symlink and do this atomically.
And I probably should.. but in some cases, particularly where the file
needs to be run through `cp` (multiple direct mode files with same
content), there's no way to atomically replace the symlink with the
content.

Anyway, the bug turns out to be something that the watcher does right for
indirect mode, but not for direct mode. When it got an add event, it
checked to see if this was a new file, or one we've already added. In the
latter case, no add event was queued. But that means that only the rm event
is queued, and so it unstages the file.

Fixed by queueing an add event even when the file is already in git.

Tested by running hundreds of drops in a loop; file remained staged.
2013-04-02 12:45:31 -04:00
..
Committer.hs assistant: Fix OSX bug that prevented committing changed files to a repository when in indirect mode. 2013-03-17 17:01:43 -04:00
ConfigMonitor.hs webapp: Now allows restarting any threads that crash. 2013-01-26 17:09:33 +11:00
DaemonStatus.hs webapp: Fix a race that sometimes caused alerts or other notifications to be missed if they occurred while a page was loading. 2013-03-27 14:56:20 -04:00
Glacier.hs add additional debug info about reasons for transfers 2013-03-01 15:23:59 -04:00
Merger.hs let's put type modules under the parent module, not in a Types directory 2013-03-10 22:24:13 -04:00
MountWatcher.hs assistant: Avoid syncing with annex-ignored remotes when reconnecting to the network, or connecting a drive. 2013-03-17 15:59:03 -04:00
NetWatcher.hs assistant: Avoid syncing with annex-ignored remotes when reconnecting to the network, or connecting a drive. 2013-03-17 15:59:03 -04:00
PairListener.hs better liftAnnex, avoid using runAnnex undefined 2013-03-04 16:36:38 -04:00
Pusher.hs webapp: Improved alerts displayed when syncing with remotes, and when syncing with a remote fails. 2013-03-18 17:23:47 -04:00
SanityChecker.hs fixed the race breaking moving files from archive in direct mode 2013-03-04 14:25:22 -04:00
TransferPoller.hs webapp: Fix a race that sometimes caused alerts or other notifications to be missed if they occurred while a page was loading. 2013-03-27 14:56:20 -04:00
Transferrer.hs avoid removing a transfer being made by another process 2013-03-28 15:16:45 -04:00
TransferScanner.hs move display of transfer scan in progress to transfers section of dashboard 2013-03-19 13:03:41 -04:00
TransferWatcher.hs let's put type modules under the parent module, not in a Types directory 2013-03-10 22:24:13 -04:00
Watcher.hs assistant: Fix bug that could cause direct mode files to be unstaged from git. 2013-04-02 12:45:31 -04:00
WebApp.hs webapp: Added UI to delete repositories. Closes: #689847 2013-03-31 16:38:05 -04:00
XMPPClient.hs fix build with xmpp and w/o webapp 2013-03-24 18:55:19 -04:00