Skip to content

Commit

Permalink
Merge pull request #5042 from mih/enh-sshnomultiplex
Browse files Browse the repository at this point in the history
NF: Make multiplexed SSH connections an optional feature
  • Loading branch information
mih committed Oct 16, 2020
2 parents b229e24 + 8717da1 commit c728888
Show file tree
Hide file tree
Showing 9 changed files with 479 additions and 225 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Expand Up @@ -67,10 +67,12 @@ matrix:
env:
- DATALAD_REPO_VERSION=6
- NOSE_SELECTION_OP=not
- DATALAD_SSH_MULTIPLEX__CONNECTIONS=0
- python: 3.5
env:
- DATALAD_REPO_VERSION=6
- NOSE_SELECTION_OP=""
- DATALAD_SSH_MULTIPLEX__CONNECTIONS=0
# To test https://github.com/datalad/datalad/pull/4342 fix in case of no "not" for NOSE.
# From our testing in that PR seems to have no effect, but kept around since should not hurt.
- LANG=bg_BG.UTF-8
Expand Down
8 changes: 8 additions & 0 deletions datalad/interface/common_cfg.py
Expand Up @@ -21,6 +21,7 @@
from datalad.support.constraints import EnsureChoice
from datalad.support.constraints import EnsureListOf
from datalad.support.constraints import EnsureStr
from datalad.utils import on_windows

dirs = AppDirs("datalad", "datalad.org")

Expand Down Expand Up @@ -268,6 +269,13 @@
'destination': 'global',
'default': None,
},
'datalad.ssh.multiplex-connections': {
'ui': ('question', {
'title': "Whether to use a single shared connection for multiple SSH processes aiming at the same target."}),
'destination': 'global',
'default': not on_windows,
'type': EnsureBool(),
},
'datalad.annex.retry': {
'ui': ('question',
{'title': 'Value for annex.retry to use for git-annex calls',
Expand Down
3 changes: 3 additions & 0 deletions datalad/support/annexrepo.py
Expand Up @@ -413,6 +413,9 @@ def _set_shared_connection(self, remote_name, url):
remote_name: str
url: str
"""
if not self.config.obtain('datalad.ssh.multiplex-connections'):
return

from datalad.support.network import is_ssh
# Note:
#
Expand Down
2 changes: 1 addition & 1 deletion datalad/support/gitrepo.py
Expand Up @@ -951,7 +951,7 @@ def __init__(self, path, url=None, runner=None, create=True,

# So that we "share" control paths with git/git-annex
if ssh_manager:
ssh_manager.assure_initialized()
ssh_manager.ensure_initialized()

# note: we may also want to distinguish between a path to the worktree
# and the actual repository
Expand Down

0 comments on commit c728888

Please sign in to comment.