RunCommand timeout

0 votes
asked Jun 12, 2015 by oddkinz (120 points)
edited Jun 12, 2015 by Tomas Knopp

We are using a version 1.0.5298.0 of Rebex.Terminal. And are trying to execute a command against a linux box using RunCommand. I have noted that the Timeout i set is not being respected.

let client = new Ssh()
client.Timeout <- 900000
client.Connect(hostname, port)
client.Login(username, generateSshPrivateKey (password, certificate))

No matter what value i set in timeout the behaviour remains the same. Is this being ignored in this version of rebex? Ive looked at the changelog but havnt found anything to suggest i do need to ensure we have a more up-to-date version.

Am i setting the timeout correctly? is there something i need to configure specifically regarding RunCommand to ensure it does not timeout?

Basically most commands we execute run successfully but any attempt to "sleep" >= 60s causes the timeout (the default it seems). We are going to want to execute long running commands where they may be periods if inactivity, i.e. no response may be received for > 60s

Any tips/help greatly received

1 Answer

0 votes
answered Jun 12, 2015 by Lukas Pokorny (101,070 points)

I have tried reproducing this agains both v1.0.5298.0 and the current version and I can't trigger the unwanted timeout after 60 seconds. Are you sure you are multiplying the seconds by 1000 to get a milisecond value needed by Ssh.Timeout property?

This is the code I used when trying to reproduce the problem:

var client = new Ssh();
client.Timeout = 900 * 1000; // 900 seconds
client.Connect(hostname, port);
client.Login(username, password);

Console.WriteLine(DateTime.Now);
client.RunCommand("sleep 120; echo Hello");
Console.WriteLine(DateTime.Now);

If you already double checked all the values and an equivalent code is still failing, please let me know.

commented Jun 15, 2015 by oddkinz (120 points)
Hi, thanks for your reply.

Great to know that your test did not show the same problem.  Perhaps it is something else our end.  We will look further into this and get back to you if necessary.

Thanks for running this test.

Regards
David
...