summaryrefslogtreecommitdiff
path: root/Assistant/Threads/Transferrer.hs
Commit message (Collapse)AuthorAge
* finished pushing Assistant monad into all relevant filesGravatar Joey Hess2012-10-30
| | | | All temporary and old functions are removed.
* pushed Assistant monad down into DaemonStatus codeGravatar Joey Hess2012-10-30
| | | | | | Currently have three old versions of functions that more reworking is needed to remove: getDaemonStatusOld, modifyDaemonStatusOld_, and modifyDaemonStatusOld
* split Commits and liftedGravatar Joey Hess2012-10-29
|
* Assistant monad, stage 3Gravatar Joey Hess2012-10-29
| | | | | | All toplevel named threads are converted to the Assistant monad. Some utility functions still need to be converted.
* Assistant monad, stage 2.5Gravatar Joey Hess2012-10-29
| | | | | | | | | | Converted several threads to run in the monad. Added a lot of useful combinators for working with the monad. Now the monad includes the name of the thread. Some debugging messages are disabled pending converting other threads.
* ensure that git-annex branch is pushed after a successful transferGravatar Joey Hess2012-10-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | I now have this topology working: assistant ---> {bare repo, special remote} <--- assistant And, I think, also this one: +----------- bare repo --------+ v v assistant ---> special remote <--- assistant While before with assistant <---> assistant connections, both sides got location info updated after a transfer, in this topology, the bare repo *might* get its location info updated, but the other assistant has no way to know that it did. And a special remote doesn't record location info, so transfers to it won't propigate out location log changes at all. So, for these to work, after a transfer succeeds, the git-annex branch needs to be pushed. This is done by recording a synthetic commit has occurred, which lets the pusher handle pushing out the change (which will include actually committing any still journalled changes to the git-annex branch). Of course, this means rather a lot more syncing action than happened before. At least the pusher bundles together very close together pushes, somewhat. Currently it just waits 2 seconds between each push.
* quiet calls to transferkeyGravatar Joey Hess2012-09-24
|
* when a Download finishes, queue UploadsGravatar Joey Hess2012-09-18
| | | | | | | | | | | | | | | | | | | This ensures file propigate takes place in situations such as: Usb drive A is connected to B. A's master branch is already in sync with B, but it is being used to sneakernet some files around, so B downloads those. There is no master branch change, so C does not request these files. B needs to upload the files it just downloaded on to C, etc. My first try at this, I saw loops happen. B uploaded to C, which then tried to upload back to B (because it had not received the updated git-annex branch from B yet). B already had the file, but it still created a transfer info file from the incoming transfer, and its watcher saw that be removed, and tried to upload back to C. These loops should have been fixed by my previous commit. (They never affected ssh remotes, only local ones, it seemed.) While C might still try to upload to B, or to some other remote that already has the file, the extra work dies out there.
* simplifyGravatar Joey Hess2012-09-17
|
* hlintGravatar Joey Hess2012-09-13
|
* display errors when any named thread crashesGravatar Joey Hess2012-09-06
|
* typoeGravatar Joey Hess2012-08-29
|
* make start button work on queued transfersGravatar Joey Hess2012-08-29
| | | | | | When multiple downloads of a key are queued, it starts the first, but leaves the other downloads in the queue. This ensures that we don't lose a queued download if the one that got started failed.
* avoid failure alerts for temporary transfer failuresGravatar Joey Hess2012-08-29
| | | | | Since a failed transfer gets retried until it succeeds, no point in bothering the user about them.
* fix a transfers display glitchGravatar Joey Hess2012-08-28
| | | | | | | | 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.
* improve display of failed transfer alertGravatar Joey Hess2012-08-27
|
* use the ~/.config/git-annex/program file to find command when running transfersGravatar Joey Hess2012-08-27
|
* add transferkey commandGravatar Joey Hess2012-08-24
| | | | | | | Used by the assistant, rather than copy, this is faster because it avoids using git ls-files, avoids checking the location log redundantly, and runs in oneshot mode, avoiding making a commit to the git-annex branch for every file transferred.
* run resumed transfers immediately, do not wait for free transfer slotGravatar Joey Hess2012-08-12
| | | | | The resumed transfer still uses a slot, so will delay other, queued transfers from starting.
* process group killingGravatar Joey Hess2012-08-10
| | | | | | | | | | | | | | | | | | | | This seems to work pretty well. Handled the process groups like this: - git-annex processes started by the assistant for transfers are run in their own process groups. - otherwise, rely on the shell to allocate a process group for git-annex There is potentially a problem if some other program runs git-annex directly (not using sh -c) The program and git-annex would then be in the same process group. If that git-annex starts a transfer and it's canceled, the program would also get killed. May or may not be a desired result. Also, the new updateTransferInfo probably closes a race where it was possible for the thread id to not be recorded in the transfer info, if the transfer info file from the transfer process is read first.
* fork off git-annex copy for transfersGravatar Joey Hess2012-08-10
| | | | | | | | | | | | | | 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.
* added an alert after a file transferGravatar Joey Hess2012-08-06
|
* fix bug in transfer initiation checkingGravatar Joey Hess2012-07-29
| | | | | | | Putting the transfer on the currentTransfers atomically introduced a bug: It checks to see if the transfer is in progress, and cancels it. Fixed by moving that check inside the STM transaction.
* refactorGravatar Joey Hess2012-07-29
|
* send notifications when the TransferQueue is changedGravatar Joey Hess2012-07-28
| | | | | | The fun part was making it move things from TransferQueue to currentTransfers entirely atomically. Which will avoid inconsistent display if the WebApp renders the current status at just the wrong time. STM to the rescue!
* move DaemonStatus manipulation out of the Annex monad to IOGravatar Joey Hess2012-07-28
| | | | | | I've convinced myself that nothing in DaemonStatus can deadlock, as it always keepts the TMVar full. That was the only reason it was in the Annex monad.
* webapp now displays the real running and queued transfersGravatar Joey Hess2012-07-27
| | | | yowza!!!
* debugging improvementsGravatar Joey Hess2012-07-20
| | | | | | add timestamps to debug messages Add lots of debug output in the assistant's threads.
* run file transfers in threads, not processesGravatar Joey Hess2012-07-18
| | | | | | 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.
* add thread id field to transferinfoGravatar Joey Hess2012-07-18
| | | | | Also converted its timestand to posix seconds, like is used in the other log files.
* merge two shouldTransfer checksGravatar Joey Hess2012-07-17
|
* fix transferrer thread's use of transfer slots and transfer info filesGravatar Joey Hess2012-07-07
| | | | | | | | Check first if a transfer needs to be done, using the location log only (for speed), and avoid occupying a slot if not. Always write a transfer info file, and keep it open throughout the tranfer process. Now transfers to remotes seem reliable.
* fixed close-together transfer raceGravatar Joey Hess2012-07-06
| | | | | The issue involved forking and they trying to read from a MVar. Reading the MVar 1st fixed it.
* wait on child transfer processes, and invalidate cacheGravatar Joey Hess2012-07-06
| | | | | | 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.
* logic errorGravatar Joey Hess2012-07-06
|
* simplifiedGravatar Joey Hess2012-07-06
| | | | background transferrs seem to work now
* it builds againGravatar Joey Hess2012-07-06
| | | | | | Currently nothing waits on transfer processes. (Second drive of the day fried. Not concentrating very well.)
* fix build (almost)Gravatar Joey Hess2012-07-06
|
* unfinished (and unbuildable) work toward separate transfer processesGravatar Joey Hess2012-07-05
|
* run transfer with copy of annex stateGravatar Joey Hess2012-07-05
| | | | | This should have made it run concurrently with other annex actions, but I'm still seeing it serialize. Perhaps I need to forkProcess?
* logic errorGravatar Joey Hess2012-07-05
|
* wrote transfer threadGravatar Joey Hess2012-07-05
finally!