summaryrefslogtreecommitdiff
path: root/Assistant
Commit message (Collapse)AuthorAge
* add two long-running XMPP push threads, no more inversion of controlGravatar Joey Hess2013-05-22
| | | | | | | | | I hope this will be easier to reason about, and less buggy. It was certianly easier to write! An immediate benefit is that with a traversable queue of push requests to select from, the threads can be a lot fairer about choosing which client to service next.
* avoid building up a lot of threads all waiting for their chance to run a pushGravatar Joey Hess2013-05-22
| | | | | Only 2 threads are needed, one running, and one waiting to push something new. Any more is redundant and wasteful.
* perhaps this fixes the stall tbdGravatar Joey Hess2013-05-21
|
* include HEAD in CanPush shasGravatar Joey Hess2013-05-21
|
* XMPP: Avoid redundant and unncessary pushes. Note that this breaks ↵Gravatar Joey Hess2013-05-21
| | | | compatibility with previous versions of git-annex, which will refuse to accept any XMPP pushes from this version.
* per-client inboxes for push messagesGravatar Joey Hess2013-05-21
| | | | | | | | | | | This will avoid losing any messages received from 1 client when a push involving another client is running. Additionally, the handling of push initiation is improved, it's no longer allowed to run multiples of the same type of push to the same client. Still stalls sometimes :(
* XMPP: Be better at responding to CanPush messages when busy with something else.Gravatar Joey Hess2013-05-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Observed: With 2 xmpp clients, one would sometimes stop responding to CanPush messages. Often it was in the middle of a receive-pack of its own (or was waiting for a failed one to time out). Now these are always immediately responded to, which is fine; the point of CanPush is to find out if there's another client out there that's interested in our push. Also, in queueNetPushMessage, queue push initiation messages when we're already running the side of the push they would initiate. Before, these messages were sent into the netMessagesPush channel, which was wrong. The xmpp send-pack and receive-pack code discarded such messages. This still doesn't make XMPP push 100% robust. In testing, I am seeing it sometimes try to run two send-packs, or two receive-packs at once to the same client (probably because the client sent two requests). Also, I'm seeing rather a lot of cases where it stalls out until it runs into the 120 second timeout and cancels a push. And finally, there seems to be a bug in runPush. I have logs that show it running its setup action, but never its cleanup action. How is this possible given its use of E.bracket? Either some exception is finding its way through, or the action somehow stalls forever. When this happens, one of the 2 clients stops syncing.
* XMPP: Ignore duplicate messages received when pushing.Gravatar Joey Hess2013-05-20
|
* Switch to MonadCatchIO-transformers for better handling of state while ↵Gravatar Joey Hess2013-05-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | catching exceptions. As seen in this bug report, the lifted exception handling using the StateT monad throws away state changes when an action throws an exception. http://git-annex.branchable.com/bugs/git_annex_fork_bombs_on_gpg_file/ .. Which can result in cached values being redundantly calculated, or other possibly worse bugs when the annex state gets out of sync with reality. This switches from a StateT AnnexState to a ReaderT (MVar AnnexState). All changes to the state go via the MVar. So when an Annex action is running inside an exception handler, and it makes some changes, they immediately go into affect in the MVar. If it then throws an exception (or even crashes its thread!), the state changes are still in effect. The MonadCatchIO-transformers change is actually only incidental. I could have kept on using lifted-base for the exception handling. However, I'd have needed to write a new instance of MonadBaseControl for the new monad.. and I didn't write the old instance.. I begged Bas and he kindly sent it to me. Happily, MonadCatchIO-transformers is able to derive a MonadCatchIO instance for my monad. This is a deep level change. It passes the test suite! What could it break? Well.. The most likely breakage would be to code that runs an Annex action in an exception handler, and *wants* state changes to be thrown away. Perhaps the state changes leaves the state inconsistent, or wrong. Since there are relatively few places in git-annex that catch exceptions in the Annex monad, and the AnnexState is generally just used to cache calculated data, this is unlikely to be a problem. Oh yeah, this change also makes Assistant.Types.ThreadedMonad a bit redundant. It's now entirely possible to run concurrent Annex actions in different threads, all sharing access to the same state! The ThreadedMonad just adds some extra work on top of that, with its own MVar, and avoids such actions possibly stepping on one-another's toes. I have not gotten rid of it, but might try that later. Being able to run concurrent Annex actions would simplify parts of the Assistant code.
* test suite passes in direct modeGravatar Joey Hess2013-05-17
| | | | | | | | | | | This fixes a bug with git annex add in direct mode. If some files already existed in the tree pointing at the same key as a file that was just added, and their content was not present, add neglected to copy the content to those files. I also changed the behavior of moveAnnex slightly: When content is moved into the annex in direct mode, it does not overwrite any content already present in direct mode files. That content may be modified after all.
* rename moduleGravatar Joey Hess2013-05-12
|
* clean up from windows portingGravatar Joey Hess2013-05-11
|
* fix for AndroidGravatar Joey Hess2013-05-09
|
* fix use of wrong shebang when android is installing git-annex-shell wrapper ↵Gravatar Joey Hess2013-05-06
| | | | on server
* --listen is not supported on AndroidGravatar Joey Hess2013-05-02
|
* avoid auto-accepting pair requests from friends already paired withGravatar Joey Hess2013-04-30
| | | | | | | Unless the request is for repo uuid we already know. This way, if A1 pairs with friend B1, and B1 pairs with device B2, then B1 can request A1 pair with it and no confirmation is needed. (In future, may want to try to do that automatically, to make a more robust network.)
* assistant: Fix bug that could cause incoming pushes to not get merged into ↵Gravatar Joey Hess2013-04-30
| | | | | | | | | | the local tree. Observed that the pushed refs were received, but not merged into master. The merger never saw an add event for these refs. Either git is not writing to a new file and renaming it into place, or the inotify code didn't notice that. Changed it to also watch for modify events and that seems to have fixed it!
* more xmpp debuggingGravatar Joey Hess2013-04-30
|
* add uuid to all xmpp messagesGravatar Joey Hess2013-04-30
| | | | | | | | | | | | | | | | | | (Except for the actual streaming of receive-pack through XMPP, which can only run once we've gotten an appropriate uuid in a push initiation message.) Pushes are now only initiated when the initiation message comes from a known uuid. This allows multiple distinct repositories to use the same xmpp address. Note: This probably breaks initial push after xmpp pairing, because at that point we may not know about the paired uuid, and so reject the push from it. It won't break in simple cases, because the annex-uuid of the remote is checked. However, when there are multiple clients behind a single xmpp address, only uuid of the first is recorded in annex-uuid, and so any pushes from the others will be rejected (unless the first remote pushes their uuids to us beforehand.
* webapp: Now automatically fills in any creds used by an existing remote when ↵Gravatar Joey Hess2013-04-27
| | | | creating a new remote of the same type. Done for Internet Archive, S3, Glacier, and Box.com remotes.
* To enable an existing special remote, the new enableremote command must be ↵Gravatar Joey Hess2013-04-26
| | | | used. The initremote command now is used only to create new special remotes.
* Internet Archive!Gravatar Joey Hess2013-04-25
| | | | | | | * Add public repository group. * webapp: Can now set up Internet Archive repositories. TODO: Enabling IA repositories.
* use DList for the transfer queueGravatar Joey Hess2013-04-25
| | | | | Some nice efficiency gains here for list appending, although mostly the small size of the transfer queue makes them irrelivant.
* use a DList for the deferred downloads queueGravatar Joey Hess2013-04-25
|
* committer tweak to wait for Watcher to resume after a max-size commitGravatar Joey Hess2013-04-25
| | | | | | Without this, a very large batch add has commits of sizes approx 5000, 2500, 1250, etc down to 10, and then starts over at 5000. This fixes it so it's 5000+ every time.
* optimise direct mode startup scanGravatar Joey Hess2013-04-24
| | | | | A recent change made existing symlinks be re-staged. That does not need to be done during the startup scan though.
* assistant: Sanitize XMPP presence information logged for debugging.Gravatar Joey Hess2013-04-24
|
* get rid of need to run pre-commit hook when assistant commits in direct modeGravatar Joey Hess2013-04-24
| | | | | | | | | | | That hook updates associated file bookkeeping info for direct mode. But, everything already called addAssociatedFile when adding/changing a file. It only needed to also call removeAssociatedFile when deleting a file, or a directory. This should make bulk adds faster, by some possibly significant amount. Bulk removals may be a little slower, since it has to use catKeyFile now on each removed file, but will still be faster than adds.
* fix 5244ab7656e2269676cf6296718c8e5243c5b919Gravatar Joey Hess2013-04-24
| | | | Converted back to the wrong type, oops.
* refactoring and minor performance tweakGravatar Joey Hess2013-04-24
|
* remove last use of TSetGravatar Joey Hess2013-04-24
|
* batch commit every 5 thousand changes, not 10 thousandGravatar Joey Hess2013-04-24
| | | | | | | | | | | There's a tradeoff between making less frequent commits, and needing to use memory to store all the changes that are coming in. At 10 thousand, it needs 150 mb of memory. 5 thousand drops that down to 90 mb or so. This also turns out to have significant imact on total run time. I benchmarked 10k changes taking 27 minutes. But two 5k batches took only 21 minutes.
* convert PendingAddChange back to Change when an add failsGravatar Joey Hess2013-04-24
| | | | | | | If an add failed, we should lose the KeySource, since it, presumably, differs due to a change that was made to the file. (The locked down file is already deleted.)
* use TList for ChangePoolGravatar Joey Hess2013-04-24
|
* show one alert when bulk adding filesGravatar Joey Hess2013-04-24
| | | | | | | | | | | | Turns out that a lot of the time spent in a bulk add was just updating the add alert to rotate through each file that was added. Showing one alert makes for a significant speedup. Also, when the webapp is open, this makes it take quite a lot less cpu during bulk adds. Also, it lets the user know when a bulk add happened, which is sorta nice..
* only show latest warning, rather than combining warning alertsGravatar Joey Hess2013-04-24
| | | | | | | In the case of the inotify limit warning, particularly, if it happens once it will be happening repeatedly, and so combining alerts resulted in a much too large alert message that took up a lot of memory and was too large for the webapp to display.
* assistant: when an add fails, requeue it for laterGravatar Joey Hess2013-04-23
| | | | See analysis in bug report for one way this could happen.
* more efficient data type for ChangeChanGravatar Joey Hess2013-04-23
| | | | | | | | | | Making this a tset of lists of Changes, rather than a tset of Changes makes refilling it, in batch mode, much more efficient. Rather than needing to add every Change it's collected one at a time, it can add them in one fast batch operation. It would be more efficient yet to use a Set, but that would need an Eq instance for InodeCache.
* rename moduleGravatar Joey Hess2013-04-23
|
* expose Control.Monad.joinGravatar Joey Hess2013-04-22
| | | | | I think I've been looking for that function for some time. Ie, I remember wanting to collapse Just Nothing to Nothing.
* assistant: When built with git before 1.8.0, use `git remote rm` to delete a ↵Gravatar Joey Hess2013-04-22
| | | | remote. Newer git uses `git remote remove`.
* Detect systems that have no user name set in GECOS, and also don't have ↵Gravatar Joey Hess2013-04-22
| | | | user.name set in git config, and put in a workaround so that commits to the git-annex branch (and the assistant) will still succeed despite git not liking the system configuration.
* sync, assistant: Sync with remotes that have annex-ignore setGravatar Joey Hess2013-04-22
| | | | | | | | This is so git remotes on servers without git-annex installed can be used to keep clients' git repos in sync. This is a behavior change, but since annex-sync can be set to disable syncing with a remote, I think it's acceptable.
* fix osx buildGravatar Joey Hess2013-04-22
|
* forgot to commit this new fileGravatar Joey Hess2013-04-20
|
* fix menu file installation directoryGravatar Joey Hess2013-04-20
|
* fix warningGravatar Joey Hess2013-04-20
|
* Install FDO desktop menu file when webapp is started in standalone mode.Gravatar Joey Hess2013-04-20
|
* assistant: Work around misfeature in git 1.8.2 that makes `git commit ↵Gravatar Joey Hess2013-04-18
| | | | | | --alow-empty -m ""` run an editor. See http://git-annex.branchable.com/bugs/assistant_hangs_during_commit/
* refactor static route definition -- android webapp build fixGravatar Joey Hess2013-04-17
| | | | | | Incidentially should work around the last problem that prevented the webapp building on Android. (Except for a few places I need to clean up after hand-fixing the spliced TH code.)