Skip Menu |

This queue is for tickets about the IPC-Run CPAN distribution.

Report information
The Basics
Id: 56403
Status: rejected
Priority: 0/
Queue: IPC-Run

People
Owner: TODDR [...] cpan.org
Requestors: Jiangcheng.Bao [...] deshaw.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.82
Fixed in: (no value)



Subject: IPC::Run::run not timeout properly when run command via ssh
If I run an external command on localhost using IPC::Run, I can timeout it properly my ($in, $out, $err, @cmd); @cmd = ("/bin/true”); run \@cmd, \$in, \$out, \$err, timeout(5), debug => 1; The above script would finish in less than 0.1 seconds. However, if the command contains ssh, i.e., I am running the command on another host via ssh, timeout doesn’t work: @cmd = ("ssh", "anotherhost", "/bin/true"); run \@cmd, \$in, \$out, \$err, timeout(5); This code would take 6.534 seconds to finish. Note that I am using a dummy hostname above. For the actual host, ssh works fine. Running the entire command including ssh in a shell finishes in less than one second. If I increase the timeout, the time it took to finish would increase accordingly. For example, if the timeout is set to 10 seconds, the actual time it took the script to finish would be 11.529 seconds. I'd appreciate if anybody has any input on this, or maybe I am missing something in the doc completely? Thanks J Bao
I'm not saying this isn't a bug, but if the problem is only with ssh, I'd encourage you to look at Net::OpenSSH, which specifically focuses on interfacing with ssh. I've found it very useful in the past. Note that you must be interfacing with Open SSH in order for this to work for you.
What OS is this? Also a perl -V might be helpful.
Thanks. I will look into that. Are you aware if Net::OpenSSH allows one to capture the output and error separately, as well as the exit code? On Thu Apr 08 16:55:34 2010, TODDR wrote: Show quoted text
> I'm not saying this isn't a bug, but if the problem is only with ssh, > I'd encourage you to look at > Net::OpenSSH, which specifically focuses on interfacing with ssh. I've > found it very useful in the > past. > > Note that you must be interfacing with Open SSH in order for this to > work for you.
From: Bao, J
It is Sun OS 5.10, Perl 5.10 64bit. On Thu Apr 08 16:56:38 2010, TODDR wrote: Show quoted text
> What OS is this? Also a perl -V might be helpful.
On Thu Apr 08 17:09:25 2010, http://www.google.com/profiles/jbao605 wrote: Show quoted text
> Thanks. I will look into that. Are you aware if Net::OpenSSH allows > one to capture the output and error separately, as well as the exit code? >
Yep. IMO, it does way more than IPC::Run can when dealing with ssh
Hi can you tell me if Net::OpenSSH fixed your problem? I plan to leave the ticket open, but It would be helpful to know down the road so we know if this is a viable alternative.
No solution but I released a dev release on another ticket and realized I never TODO'd this test when adding it originally.
Net::OpenSSH is a much better solution than running ssh via IPC::Run. Resolving issue as not relevant to IPC::Run