Repo does not detect, if ssh connection fails

37 views
Skip to first unread message

Timo Lotterbach

unread,
Jul 15, 2016, 10:34:31 AM7/15/16
to Repo and Gerrit Discussion
Hi everyone,

repo currently starts an subprocess for ssh and waits 1 sec to let ssh do it's job.
After that 1 sec, repo assumed everthing should be ok.
Instead it should check, if ssh is still running. For many ssh errors (e.g. connection refused, auth error)
ssh will return within that 1 sec and give an error.

Here's my patch proposal:

--- a/git_config.py
+++ b/git_config.py
@@ -464,9 +464,13 @@ def _open_ssh(host, port=None):
              % (host,port, str(e)), file=sys.stderr)
       return False

+    time.sleep(1)
+    ssh_died = (p.poll() is not None)
+    if ssh_died:
+      return False
+
     _master_processes.append(p)
     _master_keys.add(key)
-    time.sleep(1)
     return True
   finally:
     _master_keys_lock.release()

I would be happy to get your feedback.

Thanks,
Timo Lotterbach

Timo Lotterbach

unread,
Jul 18, 2016, 9:33:19 AM7/18/16
to Repo and Gerrit Discussion
Hi everyone,

the patch was uploaded to project's gerrit to review.

Thanks,
Timo Lotterbach
Reply all
Reply to author
Forward
0 new messages