in reply to Re^5: Net::SFTP::Foreign works intermittently
in thread Net::SFTP::Foreign works intermittently

Yes, all the tasks are connecting to the same server with the same authentication credentials. And each Gearman worker runs in its own process. Can you tell me on how to run the strace thing? any examples.
  • Comment on Re^6: Net::SFTP::Foreign works intermittently

Replies are listed 'Best First'.
Re^7: Net::SFTP::Foreign works intermittently
by salva (Canon) on Jun 17, 2014 at 12:09 UTC
    How many workers are you running in parallel?

    OpenSSH server has a configuration directive (MaxStartups) which allows to limit the number of not-yet-authorized connections. The default value is 10.

    Regarding strace, as root run:

    echo 0 > /proc/sys/kernel/yama/ptrace_scope
    Then you can attach strace processes to your workers adding the following code to them:
    system "strace -f -o /tmp/strace.$$.out -p $$ &";
    That will dump all the OS calls to the file strace.$$.out. There, you should be able to see the Perl process writing the password to the master pty side and the ssh process reading it from the slave side.
Re^7: Net::SFTP::Foreign works intermittently
by salva (Canon) on Jun 17, 2014 at 13:14 UTC
    Could you try to reproduce the problem with some variation of the script here?