Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
linjunzhu opened this issue Apr 19, 2018 · 0 comments
Open

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

linjunzhu opened this issue Apr 19, 2018 · 0 comments

Comments

@linjunzhu
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant