Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Commit

Permalink
Repo: improve error detection for new ssh connections
Browse files Browse the repository at this point in the history
this check can only detect errors that happen within 1 sec after launching
ssh. But this is typically enough to catch configuration issues like
'connection refused' or 'authentication failed'.

Change-Id: I00b6f62d4c2889b1faa6c820e49a198554c92795
  • Loading branch information
Timo Lotterbach committed Aug 30, 2016
1 parent 39252ba commit 05dc46b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion git_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 05dc46b

Please sign in to comment.