diff options
author | Doug Anderson <dianders@google.com> | 2010-12-21 13:39:23 -0800 |
---|---|---|
committer | Doug Anderson <dianders@google.com> | 2010-12-21 13:39:23 -0800 |
commit | 0048b69c038306fe74408a63cdd0773b0d86a8fe (patch) | |
tree | ca5fb88b7b5a6a196d066172f4e59f37e626f5cf /main.py | |
parent | 2b8db3ce3e7344b9f3b5216637c5af0d54be5656 (diff) | |
download | git-repo-0048b69c038306fe74408a63cdd0773b0d86a8fe.tar.gz |
Fixed race condition in 'repo sync -jN' that would open multiple masters.v1.7.2
This fixes the SSH Control Masters to be managed in a thread-safe
fashion. This is important because "repo sync -jN" uses threads to
sync more than one repository at the same time. The problem didn't
show up earlier because it was masked if all of the threads tried to
connect to the same host that was used on the "repo init" line.
Diffstat (limited to 'main.py')
-rwxr-xr-x | main.py | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -28,7 +28,7 @@ import re | |||
28 | import sys | 28 | import sys |
29 | 29 | ||
30 | from trace import SetTrace | 30 | from trace import SetTrace |
31 | from git_config import close_ssh | 31 | from git_config import init_ssh, close_ssh |
32 | from command import InteractiveCommand | 32 | from command import InteractiveCommand |
33 | from command import MirrorSafeCommand | 33 | from command import MirrorSafeCommand |
34 | from command import PagedCommand | 34 | from command import PagedCommand |
@@ -214,6 +214,7 @@ def _Main(argv): | |||
214 | repo = _Repo(opt.repodir) | 214 | repo = _Repo(opt.repodir) |
215 | try: | 215 | try: |
216 | try: | 216 | try: |
217 | init_ssh() | ||
217 | repo._Run(argv) | 218 | repo._Run(argv) |
218 | finally: | 219 | finally: |
219 | close_ssh() | 220 | close_ssh() |