Commit graph

14 commits

Author SHA1 Message Date
Joey Hess
df337bb63b hlint 2012-09-13 00:57:52 -04:00
Joey Hess
0e205184bb use only one level of exception handling for transfer slot 2012-08-29 21:28:59 -04:00
Joey Hess
ab6e1221ce bug 2012-08-29 18:25:28 -04:00
Joey Hess
5d5b6c8be2 fix repeated pause and resume of a transfer
I had an intuition that throwTo might be blocking because an exception was
caught and the exception handler was running. This seems to be the case,
and is avoided by using try. However, I can't really find anywhere in
throwTo's documentation that justifies this behavior.
2012-08-29 18:02:52 -04:00
Joey Hess
c59ba80b5b remove debug prints 2012-08-29 14:06:45 -04:00
Joey Hess
0dd7860393 fix a transfers display glitch
Run code that pops off the next queued transfer and adds it to the active
transfer map within an allocated transfer slot, rather than before
allocating a slot. Fixes the transfers display, which had been displaying
the next transfer as a running transfer, while the previous transfer was
still running.
2012-08-28 17:17:09 -04:00
Joey Hess
a73e271d60 run resumed transfers immediately, do not wait for free transfer slot
The resumed transfer still uses a slot, so will delay other, queued
transfers from starting.
2012-08-12 12:36:08 -04:00
Joey Hess
8ba9830653 implement pausing of transfers
A paused transfer's thread keeps running, keeping the slot in use.
This is intentional; pausing a transfer should not let other
queued transfers to run in its place.
2012-08-10 18:42:44 -04:00
Joey Hess
d5e06e7b89 fork off git-annex copy for transfers
This doesn't quite work, because canceling a transfer sends a signal
to git-annex, but not to rsync (etc).

Looked at making git-annex run in its own process group, which could then
be killed, and would kill child processes. But, rsync checks if it's
process group is the foreground process group and doesn't show progress if
not, and when git has run git-annex, if git-annex makes a new process
group, that is not the case. Also, if git has run git-annex, ctrl-c
wouldn't be propigated to it if it made a new process group.

So this seems like a blind alley, but recording it here just in case.
2012-08-10 14:14:08 -04:00
Joey Hess
20203b45b9 transfer canceling
Should work (untested) for transfers being run by other processes.

Not yet by transfers being run by the assistant. killThread does not
kill processes forked off by a thread. To fix this, will probably
need to make `git annex getkey` and `git annex sendkey` commands that
operate on keys, and write their own transfer info. Then the assistant
can run them, and kill them, as needed.
2012-08-08 17:55:56 -04:00
Joey Hess
6107328a6b avoid spawning new transfer thread until a slot becomes available 2012-07-25 12:07:30 -04:00
Joey Hess
cf47bb3f50 run file transfers in threads, not processes
This should fix OSX/BSD issues with not noticing transfer information
files with kqueue. Now that threads are used, the thread can manage the
transfer slot allocation and deallocation by itself; much cleaner.
2012-07-18 19:15:34 -04:00
Joey Hess
cc6f660752 fix transfer slots blocking and refilling when transfers are stopped
There's a bug, if a transfer process notices it needs to do nothing,
it never starts the transfer, so the slot is never freed.
2012-07-06 21:59:45 -06:00
Joey Hess
430ad8ce85 it builds again
Currently nothing waits on transfer processes.

(Second drive of the day fried. Not concentrating very well.)
2012-07-06 16:41:37 -04:00