git-annex/Assistant
Joey Hess e5b4d447b6 assistant: Start a new git-annex transferkeys process after a network connection change
So that remotes that use a persistent network connection are restarted.

A remote might keep open a long duration network connection, and could
fail to deal well with losing the connection. This is particularly a
concern now that we have external special reotes. An external
special remote that is implemented naively might open the connection only
when PREPARE is sent, and if it loses connection, throw errors on each
request that is made.

(Note that the ssh connection caching should not have this problem; if the
long-duration ssh process loses connection, the named pipe is disconnected
and the next ssh attempt will reconnect. Also, XMPP already deals with
disconnection robustly in its own way.)

There's no way for git-annex to know if a lost network connection actually
affects a given remote, which might have a transfer in process. It does not
make sense to force kill the transferkeys process every time the NetWatcher
detects a change. (Especially because the NetWatcher sometimes polls 1
change per hour.)

In any case, the NetWatcher only detects connection to a network, not
disconnection. So if a transfer is in progress over the network, and the
network goes down, that will need to time out on its own.

An alternate approch that was considered is to use a separate transferkeys
process for each remote, and detect when a request fails, and assume that
means that process is in a failing state and restart it. The problem with
that approach is that if a resource is not available and a remote fails
every time, it degrades to starting a new transferkeys process for every
file transfer, which is too expensive.

Instead, this commit only handles the network reconnection case, and restarts
transferkeys only once the network has reconnected and another transfer needs
to be made. So, a transferkeys process will be reused for 1 hour, or until the
next network connection.

----

The NotificationBroadcaster was rewritten to use TMVars rather than MSampleVars,
to allow checking without blocking if a notification has been received.

----

This commit was sponsored by Tobias Brunner.
2014-01-06 16:03:39 -04:00
..
Alert assistant: Fixed several minor memory leaks that manifested when adding a large number of files. 2014-01-05 21:30:48 -04:00
Install squash warning in OSX build 2013-12-15 17:10:24 -04:00
Pairing external special remotes mostly implemented (untested) 2013-12-26 18:23:13 -04:00
Threads assistant: Set StrictHostKeyChecking yes when creating ssh remotes, and add it to the configuration for any ssh remotes previously created by the assistant. This avoids repeated prompts by ssh if the host key changes, instead syncing with such a remote will fail. Closes: #732602 2013-12-20 20:58:36 -04:00
Types assistant: Start a new git-annex transferkeys process after a network connection change 2014-01-06 16:03:39 -04:00
WebApp Windows: Avoid eating stdin when running ssh to add a authorized key, since this is used for password prompting. 2014-01-01 15:49:51 -04:00
XMPP When an XMPP server has SRV records, try them, but don't then fall back to the regular host if they all fail. 2013-07-20 21:18:55 -04:00
Alert.hs assistant: Fixed several minor memory leaks that manifested when adding a large number of files. 2014-01-05 21:30:48 -04:00
BranchChange.hs split BranchChange and lifted 2012-10-29 19:20:54 -04:00
Changes.hs use DList for the transfer queue 2013-04-25 01:33:44 -04:00
Commits.hs remove last use of TSet 2013-04-24 17:16:04 -04:00
Common.hs refactor alert button creation code 2013-04-04 01:48:26 -04:00
DaemonStatus.hs assistant: Fixed several minor memory leaks that manifested when adding a large number of files. 2014-01-05 21:30:48 -04:00
DeleteRemote.hs add config page for fsck, and alert with button when a fsck is running 2013-10-10 18:05:53 -04:00
Drop.hs mirror: Support --all (and --unused). 2014-01-01 17:39:33 -04:00
Fsck.hs webapp: remind user when using repositories that lack consistency checks 2013-10-29 16:50:38 -04:00
Gpg.hs webapp: Support storing encrypted git repositories on rsync.net. 2013-09-26 16:43:00 -04:00
Install.hs avoid empty env vars when setting up clean environment 2013-12-31 14:55:55 -04:00
MakeRemote.hs webapp: Improve UI around remote that have no annex.uuid set, either because setup of them is incomplete, or because the remote git repository is not a git-annex repository. 2013-11-07 18:02:00 -04:00
Monad.hs assistant: Start a new git-annex transferkeys process after a network connection change 2014-01-06 16:03:39 -04:00
NamedThread.hs restart on upgrade is working, including automatic restart 2013-11-23 00:54:08 -04:00
NetMessager.hs clarify notifyNetMessagerRestart 2013-08-24 13:49:04 -04:00
Pairing.hs Improve local pairing behavior when two computers both try to start the pairing process separately. 2013-11-02 15:10:29 -04:00
Pushes.hs whitespace fixes 2012-12-13 00:45:27 -04:00
Repair.hs Assistant: Remove stale MERGE_HEAD files in lockfile cleanup. 2014-01-01 22:05:33 -04:00
RepoProblem.hs add post-repair actions 2013-10-29 14:25:20 -04:00
Restart.hs pull in Win32-extras, to be able to get current process id in Windows 2013-12-11 00:15:10 -04:00
ScanRemotes.hs assistant: Fixed several minor memory leaks that manifested when adding a large number of files. 2014-01-05 21:30:48 -04:00
Ssh.hs assistant: Ensure that .ssh/config and .ssh/authorized_keys are not group or world writable when writing to those files, as that can make ssh refuse to use them, if it allows another user to write to them. 2014-01-03 17:44:12 -04:00
Sync.hs Remotes can now be made read-only, by setting remote.<name>.annex-readonly 2014-01-02 13:12:32 -04:00
TransferQueue.hs assistant: Fixed several minor memory leaks that manifested when adding a large number of files. 2014-01-05 21:30:48 -04:00
TransferrerPool.hs assistant: Start a new git-annex transferkeys process after a network connection change 2014-01-06 16:03:39 -04:00
TransferSlots.hs typo 2013-12-10 23:55:15 -04:00
Upgrade.hs one more wrong dir 2013-11-25 14:52:04 -04:00
WebApp.hs clean up build warnings with yesod 1.2, while still building with 1.1 2013-06-27 01:15:28 -04:00
XMPP.hs allow to build when sandi is installed (don't use it yet) 2013-11-11 15:42:06 -04:00