Simon Cornish
2014-10-25 06:10:57 UTC
If a remote server fails to respond during the early SSH protocol
phases then the ssh_sftp:start_channel call will hang for as long as
the server keeps the TCP connection alive, regardless of the values of
the timeout or connect_timeout options.
A fake hanging server can be found here:
https://gist.github.com/dotsimon/60e67fc63a1c4c9e3692
This patch passes the Timeout through to ssh:connect. In case the
timeout occurs during these phases, {error, timeout} is returned.
git fetch ***@github.com:dotsimon/otp.git ssh_connect_timeout
https://github.com/dotsimon/otp/compare/erlang:maint...ssh_connect_timeout
https://github.com/dotsimon/otp/compare/erlang:maint...ssh_connect_timeout.patch
phases then the ssh_sftp:start_channel call will hang for as long as
the server keeps the TCP connection alive, regardless of the values of
the timeout or connect_timeout options.
A fake hanging server can be found here:
https://gist.github.com/dotsimon/60e67fc63a1c4c9e3692
This patch passes the Timeout through to ssh:connect. In case the
timeout occurs during these phases, {error, timeout} is returned.
git fetch ***@github.com:dotsimon/otp.git ssh_connect_timeout
https://github.com/dotsimon/otp/compare/erlang:maint...ssh_connect_timeout
https://github.com/dotsimon/otp/compare/erlang:maint...ssh_connect_timeout.patch