Ssh password prompting improved when using -J

When ssh connection caching is enabled (and when GIT_ANNEX_USE_GIT_SSH is
not set), only one ssh password prompt will be made per host, and only one
ssh password prompt will be made at a time.

This also fixes a race in prepSocket's stale ssh connection stopping
when run with -J. It was possible for one thread to start a cached ssh
connection, and another thread to immediately stop it, resulting in excess
connections being made.

This commit was supported by the NSF-funded DataLad project.
This commit is contained in:
Joey Hess 2017-05-11 17:33:18 -04:00
parent 782c30b8a4
commit 6992fe133b
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
8 changed files with 104 additions and 36 deletions

View file

@ -37,9 +37,6 @@ non-concurrent uses the current, faster path.
prepSocket takes a shared
file level lock of the socket's lock file, which is used to tell when
another git-annex process is using the connection multiplexer.
So, an optimisation would be for prepSocket to try to take a non-blocking
exclusive file-level lock. If it fails, it knows some process has
already taken the shared lock, and so the multiplexer is started and no
password prompting needs to be done. So it does not need to try to start
the multiplexer in this case.
So, an optimisation would be for prepSocket to check if it's already
taken that shared lock, and then it does not need to start the multiplexer.
"""]]