Skip to content

When i use long running task in remote server, it will timeout #7

Description

@linjunzhu

net-ssh (4.2.0)
net-ssh-telnet (0.2.1)

ssh = Net::SSH.start(target_server, target_user, :keepalive => true, :keepalive_interval => 10)
shell = Net::SSH::Telnet.new("Session" => ssh, "Timeout" => 60)

ssh.exec!("sleep 3600")
puts "i am still ok"

It will be fine

ssh = Net::SSH.start(target_server, target_user, :keepalive => true, :keepalive_interval => 10)
shell = Net::SSH::Telnet.new("Session" => ssh, "Timeout" => 60)

shell.cmd("sleep 3600")
puts "i am still ok"

it will never puts 'i am still ok' and will raise exception:

/home/deploy/.rvm/gems/ruby-2.3.1@rails4.2/gems/net-ssh-telnet-0.2.1/lib/net/ssh/telnet.rb:363:in `waitfor': uninitialized constant Net::ReadTimeout (NameError)
	from /home/deploy/.rvm/gems/ruby-2.3.1@rails4.2/gems/net-ssh-telnet-0.2.1/lib/net/ssh/telnet.rb:473:in `cmd'

I increase timeout to 5000. Client will like not response and cannot execute next step When sleep time up

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions