From 3783ccf2529b7e566183684579835bb9541a4596 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 19 Jan 2012 20:41:20 -0400 Subject: design --- ..._repeated_password_prompts_for_one_command.mdwn | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'doc') diff --git a/doc/todo/wishlist:_Prevent_repeated_password_prompts_for_one_command.mdwn b/doc/todo/wishlist:_Prevent_repeated_password_prompts_for_one_command.mdwn index 808b8496f..e5b5e3c5c 100644 --- a/doc/todo/wishlist:_Prevent_repeated_password_prompts_for_one_command.mdwn +++ b/doc/todo/wishlist:_Prevent_repeated_password_prompts_for_one_command.mdwn @@ -16,3 +16,34 @@ Simple, when performing various git annex command over ssh, in particular a mult >> >> Complicated slightly by not doing this if the user has already set up >> more broad ssh connection caching. --[[Joey]] + +--- + +Slightly more elaborate design for using ssh connection caching: + +* Per-uuid ssh socket in `.git/annex/ssh/user@host.socket` +* Can be shared amoung concurrent git-annex processes. +* Run ssh like: `ssh -S .git/annex/ssh/user@host.socket -o ControlMaster=auto -o ControlPersist=yes user@host` +* At shutdown, enumerate all existing sockets, and on each: + 1. Rename to .old (prevents various races) + 2. `ssh -q -S .git/annex/ssh/user@host.old -o ControlMaster=auto -o ControlPersist=yes -O stop user@host` + (Will exit nonzero if ssh is not running on that socket.) + 3. And then remove the socket. +* Do same *at startup*. Why? In case an old git-annex was interrupted + and left behind a ssh. May have moved to a different network + in the meantime, etc, and be stalled waiting for a response from the + network, or talking to the wrong interface or something. + (Ie, the reason why I don't use ssh connection caching by default.) +* This would stop ssh's used by a concurrently running git-annex, + but only after they finish servicing their current connection. + Could use locks to detect if another git-annex is using a ssh + socket, but concurrent git-annex is rare enough, and the impact small + enough (next ssh it runs needs to do a full connect), that + the locks are probably not justified. Could be added later if needed tho. +* Could also set ControlPersist to something like "1h", in order to + auto-terminate leftover ssh's when git-annex is ctrl-c'd or somehow + exits. When transferring big enough files that the next ssh doesn't + happen for an hour, the overhead of that ssh needing to reconnect is + not significant. +* User should be able to override this, to use their own preferred + connection caching setup. `annex.sshcaching=false` -- cgit v1.2.3