Skip to content

Commit 5fe5151

Browse files
stevendannachris-rock
authored andcommitted
Rescue EPIPE on connect in ssh transport
SSH will raise an Errno::EPIPE if the remote server closes the connection unexpectedly. This can happen, for example, in cases where a user has an improperly configured ProxyCommand for that host in `~/.ssh/config`. Adding EPIPE to the set of exceptions to rescue ensures that we raise Train::Transports::SSHFailed which callers of train my already be rescuing.
1 parent e1da796 commit 5fe5151

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/train/transports/ssh_connection.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def uri
166166

167167
RESCUE_EXCEPTIONS_ON_ESTABLISH = [
168168
Errno::EACCES, Errno::EADDRINUSE, Errno::ECONNREFUSED, Errno::ETIMEDOUT,
169-
Errno::ECONNRESET, Errno::ENETUNREACH, Errno::EHOSTUNREACH,
169+
Errno::ECONNRESET, Errno::ENETUNREACH, Errno::EHOSTUNREACH, Errno::EPIPE,
170170
Net::SSH::Disconnect, Net::SSH::AuthenticationFailed, Net::SSH::ConnectionTimeout,
171171
Timeout::Error
172172
].freeze

0 commit comments

Comments
 (0)