summaryrefslogtreecommitdiff
path: root/Assistant
Commit message (Collapse)AuthorAge
* partially complete gcrypt remote (local send done; rest not)Gravatar Joey Hess2013-09-07
| | | | | | | | | | | | | | | | | | | | | | | | This is a git-remote-gcrypt encrypted special remote. Only sending files in to the remote works, and only for local repositories. Most of the work so far has involved making initremote work. A particular problem is that remote setup in this case needs to generate its own uuid, derivied from the gcrypt-id. That required some larger changes in the code to support. For ssh remotes, this will probably just reuse Remote.Rsync's code, so should be easy enough. And for downloading from a web remote, I will need to factor out the part of Remote.Git that does that. One particular thing that will need work is supporting hot-swapping a local gcrypt remote. I think it needs to store the gcrypt-id in the git config of the local remote, so that it can check it every time, and compare with the cached annex-uuid for the remote. If there is a mismatch, it can change both the cached annex-uuid and the gcrypt-id. That should work, and I laid some groundwork for it by already reading the remote's config when it's local. (Also needed for other reasons.) This commit was sponsored by Daniel Callahan.
* only retry every 60 secondsGravatar Joey Hess2013-08-24
| | | | | Retying every second is a bit much, especially given the current leak https://github.com/audreyt/network-multicast/issues/4
* clarify notifyNetMessagerRestartGravatar Joey Hess2013-08-24
|
* gitignore support for the assistant and watcherGravatar Joey Hess2013-08-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Requires git 1.8.4 or newer. When it's installed, a background git check-ignore process is run, and used to efficiently check ignores whenever a new file is added. Thanks to Adam Spiers, for getting the necessary support into git for this. A complication is what to do about files that are gitignored but have been checked into git anyway. git commands assume the ignore has been overridden in this case, and not need any more overriding to commit a changed version. However, for the assistant to do the same, it would have to run git ls-files to check if the ignored file is in git. This is somewhat expensive. Or it could use the running git-cat-file process to query the file that way, but that requires transferring the whole file content over a pipe, so it can be quite expensive too, for files that are not git-annex symlinks. Now imagine if the user knows that a file or directory tree will be getting frequent changes, and doesn't want the assistant to sync it, so gitignores it. The assistant could overload the system with repeated ls-files checks! So, I've decided that the assistant will not automatically commit changes to files that are gitignored. This is a tradeoff. Hopefully it won't be a problem to adjust .gitignore settings to not ignore files you want the assistant to autocommit, or to manually git annex add files that are listed in .gitignore. (This could be revisited if git-annex gets access to an interface to check the content of the index w/o forking a git command. This could be libgit2, or perhaps a separate git cat-file --batch-check process, so it wouldn't need to ship over the whole file content.) This commit was sponsored by Francois Marier. Thanks!
* better git version checkingGravatar Joey Hess2013-08-02
|
* webapp: Improve handling of remotes whose setup has stalled.Gravatar Joey Hess2013-07-31
| | | | | | | | | | | | | | | | | | | | | | | | | | This includes recovery from the ssh-agent problem that led to many reporting http://git-annex.branchable.com/bugs/Internal_Server_Error:_Unknown_UUID/ (Including fixing up .ssh/config to set IdentitiesOnly.) Remotes that have no known uuid are now displayed in the webapp as "unfinished". There's a link to check their status, and if the remote has been set annex-ignore, a retry button can be used to unset that and try again to set up the remote. As this bug has shown, the process of adding a ssh remote has some failure modes that are not really ideal. It would certianly be better if, when setting up a ssh remote it would detect if it's failed to get the UUID, and handle that in the remote setup process, rather than waiting until later and handling it this way. However, that's hard to do, particularly for local pairing, since the PairListener runs as a background thread. The best it could do is pop up an alert if there's a problem. This solution is not much different. Also, this solution handles cases where the user has gotten their repo into a mess manually and let's the assistant help with cleaning it up. This commit was sponsored by Chia Shee Liang. Thanks!
* set IdentitiesOnlyGravatar Joey Hess2013-07-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When setting up a dedicated ssh key to access the annex on a host, set IdentitiesOnly to prevent the ssh-agent from forcing use of a different ssh key. That behavior could result in unncessary password prompts. I remember getting a message or two from people who got deluged with password prompts and I couldn't at the time see why. Also, it would prevent git-annex-shell from being run on the remote host, when git-annex was installed there by unpacking the standalone tarball, since the authorized_keys line for the dedicated ssh key, which sets up calling git-annex-shell when it's not in path, wouldn't be used. This fixes http://git-annex.branchable.com/bugs/Internal_Server_Error:_Unknown_UUID but I've not closed that bug yet since I should still: 1. Investigate why the ssh remote got set up despite being so broken. 2. Make the webapp not handle the NoUUID state in such an ugly way. 3. Possibly add code to fix up systems that encountered the problem. Although since it requires changes to .ssh/config this may be one for the release notes. Thanks to TJ for pointing me in the right direction to understand what was happening here.
* assistant: Fix bug that caused it to stall when adding a very large number ↵Gravatar Joey Hess2013-07-27
| | | | | | | | | | | | | | | | of files at once (around 5 thousand). This bug was introduced in 74c30fc1a6e88d926d07e12f4e7ffc7d897bf9f6, which improved handling of adding very large numbers of files by ensuring that a minimum number of max size commits (5000 files each) were done. I accidentially made it wait for another change to appear after such a max size commit, even if a lot of queued changes were already accumulated. That resulted in a stall when it got to the end. Now fixed to not wait any longer than necessary to ensure the watcher has had time to wake back up after the max size commit. This commit was sponsored by Michael Linksvayer. Thanks!
* got hdevtools working againGravatar Joey Hess2013-07-27
| | | | Fix comment to not make cpp unhappy
* assistant: Fix deadlock that could occur when adding a lot of files at once ↵Gravatar Joey Hess2013-07-26
| | | | | | | | | | in indirect mode. This is a laziness problem. Despite the bang pattern on newfiles, the list was not being fully evaluated before cleanup was called. Moving cleanup out to after the list is actually used fixes this. More evidence that I should be using ResourceT or pipes, if any was needed.
* assistant: Fix NetWatcher to not sync with remotes that have ↵Gravatar Joey Hess2013-07-26
| | | | | | | | | | | | remote.<name>.annex-sync set to false. This affected both the hourly NetWatcherFallback thread and the syncing when network connection is detected. It was a reversion of sorts, introduced in 8655ea7f8e853b7de4defbca2655b741362ecd21, when annex-ignore was changed to not control git syncing. I forgot to make it check annex-sync at that point.
* add status tag to all presence messagesGravatar Joey Hess2013-07-25
| | | | Necessary for push messages to not override the previously sent tag.
* Add status message to XMPP presence tag, to identify to others that the ↵Gravatar Joey Hess2013-07-23
| | | | | | | | client is a git-annex client. I only added this to the presense messages that are really intended for presence. The ones used for tunneling git etc don't have the tag, because that would waste bandwidth.
* When an XMPP server has SRV records, try them, but don't then fall back to ↵Gravatar Joey Hess2013-07-20
| | | | | | | | | | | the regular host if they all fail. gmail.com has some XMPP SRV records, but does not itself respond to XMPP traffic, although it does accept connections on port 5222. So if a user entered the wrong password, it would try all the SRVs and fall back to trying gmail, and hang at that point. This seems the right thing to do, not just a workaround.
* webapp: Differentiate between creating a new S3/Glacier/WebDav remote, and ↵Gravatar Joey Hess2013-07-20
| | | | initializing an existing remote. When creating a new remote, avoid conflicts with other existing (or deleted) remotes with the same name.
* webapp: Better display of added files.Gravatar Joey Hess2013-07-10
|
* linux standalone auto-install iconsGravatar Joey Hess2013-07-09
|
* Install XDG desktop icon files.Gravatar Joey Hess2013-07-09
| | | | | | | | | | | | | | | | The icon files will be installed when running make install or cabal install. Did not try to run update-icon-caches, since I think it's debian specific, and dh_icons will take care of that for the Debian package. Using the favicon as a 16x16 icon. At 24x24 the svg displays pretty well, although the dotted lines are rather faint. The svg is ok at all higher resolutions. The standalone linux build auto-installs the desktop and autostart files when run. I have not made it auto-install the icon file too, because a) that would take more work to include them in the tarball and find them b) it would need to be an install to ~/.icons/, and I don't know if that really works!
* fix buildGravatar Joey Hess2013-07-08
|
* fix display of expected sequence numberGravatar Joey Hess2013-07-08
|
* moved AssociatedFile definitionGravatar Joey Hess2013-07-04
|
* webapp: Fix bug setting up ssh repo if the user enters "~/" at the start of ↵Gravatar Joey Hess2013-06-25
| | | | the path.
* webapp: Ensure that ssh keys generated for different directories on a server ↵Gravatar Joey Hess2013-06-25
| | | | are always different.
* fix crash in drop scan when there are no associated filesGravatar Joey Hess2013-06-24
| | | | | | | maximum is partial, so need to ensure the list is not empty. This lack of associated files would most likely be a problem -- and fsck fixes it. It could also occur legitimately due to a race.
* assistant: Daily sanity check thread is run niced.Gravatar Joey Hess2013-06-21
|
* assistant: On Linux, the expensive transfer scan is run niced.Gravatar Joey Hess2013-06-20
| | | | | | | This is a compromise. I would like to nice every thread except for the webapp thread, but it's not practical to do so. That would need every thread to run as a bound thread, which could add significant overhead. And any forkIO would escape the nice level.
* assistant: In direct mode, objects are now only dropped when all associated ↵Gravatar Joey Hess2013-06-15
| | | | files are unwanted. This avoids a repreated drop/get loop of a file that has a copy in an archive directory, and a copy not in an archive directory. (Indirect mode still has some buggy behavior in this area, since it does not keep track of associated files.) Closes: #712060
* sanity checkGravatar Joey Hess2013-06-11
|
* log local pairing messages received when debugging is enabledGravatar Joey Hess2013-06-11
|
* display any illegal character found in ssh commentGravatar Joey Hess2013-06-10
|
* Android: Make the "Open webapp" menu item open the just created repository ↵Gravatar Joey Hess2013-06-10
| | | | when a new repo is made.
* remove unnecessary haskell extensionsGravatar Joey Hess2013-06-04
|
* avoid debug logging unknown xmpp messages, which may contain sensative ↵Gravatar Joey Hess2013-05-27
| | | | information
* when xmpp connection fails, show the host(s) it tried to connect toGravatar Joey Hess2013-05-27
|
* 3 more fd leaksGravatar Joey Hess2013-05-26
|
* XMPP: Fix a file descriptor leak.Gravatar Joey Hess2013-05-26
|
* typoGravatar Joey Hess2013-05-26
|
* avoid redundant CanPush messages with different shas being queued upGravatar Joey Hess2013-05-26
|
* remove debug printGravatar Joey Hess2013-05-25
|
* XMPP: Send pings and use them to detect when contact with the server is lost.Gravatar Joey Hess2013-05-22
| | | | | | I noticed that when my modem hung up and redialed, my xmpp client was left sending messages into the void. This will also handle any idle disconnection issues.
* fix minor memory leak caused by recent CanPush changeGravatar Joey Hess2013-05-22
| | | | Putting the UUID in meant that equivilant CanPush messages no longer are ==
* 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.