Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Re^4: using Net::OpenSSH in a MCE worker thread

by salva (Abbot)
on Jun 28, 2013 at 11:59 UTC ( #1041235=note: print w/replies, xml ) Need Help??

in reply to Re^3: using Net::OpenSSH in a MCE worker thread
in thread using Net::OpenSSH in a MCE worker thread

oops, there is a bug in that part of the code that causes it to fail silently (instead of failing with an error that tells you what has gone wrong).

Try replacing it by the following version:

sub _load_module { my ($module, $version) = @_; $loaded_module{$module} ||= do { do { local ($@, $SIG{__DIE__}); eval "require $module; 1" } or croak "unable to load Perl module $module"; 1 }; if (defined $version) { my $mv = do { local ($@, $SIG{__DIE__}); eval "\$${module}::VERSION" || 0; }; (my $mv1 = $mv) =~ s/_\d*$//; croak "$module version $version required, $mv is available" if $mv1 < $version; } 1 }

Replies are listed 'Best First'.
Re^5: using Net::OpenSSH in a MCE worker thread
by Andy16 (Acolyte) on Jun 28, 2013 at 12:26 UTC
    Hi salva - thats fast! :)

    tried, but with no success... Problem, MCE worker threads have no strout/stderr to use...

    I don't get the magic of that code, but if I preload IO::Pty it works.
    Your change was for a load having a version - and IP::Pty is loaded without version specified.

    to me it still points towards using signals while running in MCE....

    hope it helps
      Try tracing the program with strace (or your favorite OS equivalent) and check the last things it does before crashing (or post here the output).
        made it to stderr (my fault supressing it - sorry....)
        error msg is:
        unable to load Perl module IO::Pty

        not that surprising - but still funny that I can preload it.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1041235]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2018-05-25 21:34 GMT
Find Nodes?
    Voting Booth?