Commit graph

116 commits

Author SHA1 Message Date
Joey Hess
b702bae950 bugfix 2012-07-17 17:22:00 -04:00
Joey Hess
9ab9ef3ebd change transfer lock filenames to avoid ambiguity
foo.lck could be a lock file for a transfer of foo, or a transfer of a key
that happened to end in ".lck". Fix this by using "lck.foo" instead.
2012-07-17 17:16:30 -04:00
Joey Hess
9379c77fb3 split transfer info and lock files
Since the lock file has to be kept open, this prevented the TransferWatcher
from noticing when it appeared, since inotify (and more importantly kqueue)
events happen when a new file is closed. Writing a separate info file fixes
that problem.
2012-07-07 11:47:36 -06:00
Joey Hess
62876502c5 wait on child transfer processes, and invalidate cache
There's still a bug; if the child updates its transfer info file,
then the data from it will superscede the TransferInfo, losing the
info that we should wait on this child.
2012-07-06 16:44:13 -06:00
Joey Hess
a92f5589fc unfinished (and unbuildable) work toward separate transfer processes 2012-07-05 18:57:06 -06:00
Joey Hess
71b5ad8398 wrote transfer thread
finally!
2012-07-05 14:34:20 -06:00
Joey Hess
4845b59413 startedTime needs to be a Maybe to handle transfers that have not started yet
This changes the file format.
2012-07-02 16:17:06 -04:00
Joey Hess
c9d7e9f6bd startedTime needs to be a Maybe to handle transfers that have not started yet
This changes the file format.
2012-07-02 16:06:52 -04:00
Joey Hess
0c0fd0c54c update 2012-07-02 13:49:27 -04:00
Joey Hess
8f6c2e6081 fix reading of empty filename from transfer info file 2012-07-02 11:02:47 -04:00
Joey Hess
9517fbb948 cleanup 2012-07-02 08:35:15 -04:00
Joey Hess
bea0ac0274 record transfers for git-annex-shell
Not yet tested and places git-annex-shell is run need to be modified to
pass the new field settings.

Note that rsyncServerSend was changed to fork, rather than directly exec
rsync, because it needs to keep the transfer lock held, and clean up the
transfer log when done.
2012-07-02 01:31:10 -04:00
Joey Hess
7225c2bfc0 record transfer information on local git remotes
In order to record a semi-useful filename associated with the key,
this required plumbing the filename all the way through to the remotes'
storeKey and retrieveKeyFile.

Note that there is potential for deadlock here, narrowly avoided.
Suppose the repos are A and B. A sends file foo to B, and at the same
time, B gets file foo from A. So, A locks its upload transfer info file,
and then locks B's download transfer info file. At the same time,
B is taking the two locks in the opposite order. This is only not a
deadlock because the lock code does not wait, and aborts. So one of A or
B's transfers will be aborted and the other transfer will continue.
Whew!
2012-07-01 17:15:11 -04:00
Joey Hess
8c10f37714 bugfixes
fdToHandle seems to close the fd

avoid excess trailing newline
2012-07-01 17:15:11 -04:00
Joey Hess
72988bae34 tested; bugfixes 2012-07-01 17:15:11 -04:00
Joey Hess
be0e38bcc3 add transfer information files 2012-07-01 17:15:11 -04:00