Browse code

Increase the escalation prompt timeout

It was set to match the SSH connect timeout. Unfortunately, they would
race when ssh fails to connect, and the connect timeout usually failed.
This led to some misleading error messages.

Fixes #12916

David M. Lee authored on 2015/11/13 12:48:20
Showing 1 changed files
... ...
@@ -392,7 +392,10 @@ class Connection(ConnectionBase):
392 392
             become_error=False, become_nopasswd_error=False
393 393
         )
394 394
 
395
-        timeout = self._play_context.timeout
395
+        # select timeout should be longer than the connect timeout, otherwise
396
+        # they will race each other when we can't connect, and the connect
397
+        # timeout usually fails
398
+        timeout = 2 + self._play_context.timeout
396 399
         rpipes = [p.stdout, p.stderr]
397 400
         for fd in rpipes:
398 401
             fcntl.fcntl(fd, fcntl.F_SETFL, fcntl.fcntl(fd, fcntl.F_GETFL) | os.O_NONBLOCK)