summaryrefslogtreecommitdiffstats
path: root/git_config.py
diff options
context:
space:
mode:
authorMike Frysinger <vapier@google.com>2021-05-05 19:44:35 -0400
committerMike Frysinger <vapier@google.com>2021-05-10 21:10:29 +0000
commit19e409c81863878d5d313fdc40b3975b98602454 (patch)
tree491d08dbc32c2e5e8acb33fcecff09a5a51613f9 /git_config.py
parent4a58100251624ddd37c3046611c110fb3077668d (diff)
downloadgit-repo-19e409c81863878d5d313fdc40b3975b98602454.tar.gz
ssh: move proxy usage to the sync subcommand
The only time we really need ssh proxies is when we want to run many connections and reuse them. That only happens when running sync. Every other command makes at most two connections, and even then it's only one or none. So the effort of setting up & tearing down ssh proxies isn't worth it most of the time. The big reason we want to move this logic to sync is that it's now using multiprocessing for parallel work. The current ssh proxy code is all based on threads, which means none of the logic is working correctly. The current ssh design makes it hard to fix when all of the state lives in the global/module scope. So the first step to fixing this is top move the setup & teardown to the one place that really needs it: sync. No other commands will use proxies anymore, just direct connections. Bug: https://crbug.com/gerrit/12389 Change-Id: Ibd351acdec39a87562b3013637c5df4ea34e03c6 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/305485 Reviewed-by: Chris Mcdonald <cjmcdonald@google.com> Tested-by: Mike Frysinger <vapier@google.com>
Diffstat (limited to 'git_config.py')
-rw-r--r--git_config.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/git_config.py b/git_config.py
index 1d8d1363..d7fef8ca 100644
--- a/git_config.py
+++ b/git_config.py
@@ -520,6 +520,14 @@ class Remote(object):
520 return self.url.replace(longest, longestUrl, 1) 520 return self.url.replace(longest, longestUrl, 1)
521 521
522 def PreConnectFetch(self): 522 def PreConnectFetch(self):
523 """Run any setup for this remote before we connect to it.
524
525 In practice, if the remote is using SSH, we'll attempt to create a new
526 SSH master session to it for reuse across projects.
527
528 Returns:
529 Whether the preconnect phase for this remote was successful.
530 """
523 connectionUrl = self._InsteadOf() 531 connectionUrl = self._InsteadOf()
524 return ssh.preconnect(connectionUrl) 532 return ssh.preconnect(connectionUrl)
525 533