Skip Menu |

This queue is for tickets about the Net-OpenSSH CPAN distribution.

Report information
The Basics
Id: 63519
Status: rejected
Worked: 20 min
Priority: 0/
Queue: Net-OpenSSH

People
Owner: salva [...] cpan.org
Requestors: rogerbush8 [...] yahoo.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)



Subject: Async option and username/password error
Distribution: Net::OpenSSH VERSION = '0.45' Perl version: v5.10.0 OS: Linux dev-admin100.dht.corp.sk1.yahoo.com 2.6.18-164.2.1.el5 #1 SMP Mon Sep 21 04:37:42 EDT 2009 x86_64 ======= Thanks for your module, it works very well. I've tried the other distributions, and this one is very easy to install. I've run into what may be an edge-case. Bug Description: I am using Net::OpenSSH object with "async => 1". If user and password are supplied, this will work if there is a single Net::OpenSSH instance. If there are multiple instances launched simultaneously (e.g. 3), then this doesn't work. I am not sure if this works _sometimes_ (i.e. a race condition). I thought that it worked once, but I couldn't get it to work again (it seemed to always fail). So it's possible this is either a race, or always fails (in any case it mostly fails for me). Failure means that: $ready = $ssh->wait_for_master (1); # Never returns $ready == true, when error occurs I am using AnyEvent and Coros to handle async behavior and this works flawlessly without passwords (i.e. any passwordless SSH setup like 'publickey'). I can simultaneously launch up to 10 SSH fine (before hitting the MAX unauth limit). The exact same code path works fine when user/pw is set and async => 0. Also note that if I give the wrong password, the code seems to fail silently when async => 1 (i.e. $error does not give a non-zero answer when tested immediately after wait_for_master).
It may seem a little odd but this is the expected behavior. In order to be consistent with the rest of the API, wait_for_master also returns false on failure. You have to use it as follows: if(!$ssh->wait_for_master(1)) { $ssh->error and die "connection failed: " . $ssh->error; } - Salva