Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

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

by salva (Monsignor)
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 }


Comment on Re^4: using Net::OpenSSH in a MCE worker thread
Download Code
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).
        hi
        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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1041235]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2014-07-12 10:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (239 votes), past polls