communicators/ssh: timeout on connection check
This commit is contained in:
parent
7f432422e1
commit
5ebd10c19c
|
@ -2,6 +2,7 @@
|
|||
|
||||
BUG FIXES:
|
||||
|
||||
- core: Fix cases where sometimes SSH connection would hang.
|
||||
- providers/docker: Create args works. [GH-4526]
|
||||
- providers/virtualbox: Show a human-friendly error if VirtualBox didn't
|
||||
clean up an existing VM. [GH-4681]
|
||||
|
|
|
@ -265,8 +265,13 @@ module VagrantPlugins
|
|||
# There is a chance that the socket is closed despite us checking
|
||||
# 'closed?' above. To test this we need to send data through the
|
||||
# socket.
|
||||
#
|
||||
# We wrap the check itself in a 5 second timeout because there
|
||||
# are some cases where this will just hang.
|
||||
begin
|
||||
@connection.exec!("")
|
||||
Timeout.timeout(5) do
|
||||
@connection.exec!("")
|
||||
end
|
||||
rescue Exception => e
|
||||
@logger.info("Connection errored, not re-using. Will reconnect.")
|
||||
@logger.debug(e.inspect)
|
||||
|
|
Loading…
Reference in New Issue