Skip Menu |
 
rt.cpan.org will be shut down on March 1st, 2021.

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

Report information
The Basics
Id: 112101
Status: resolved
Priority: 0/
Queue: Net-SFTP-Foreign

People
Owner: Nobody in particular
Requestors: Chris.Denley [...] experian.com
Cc:
AdminCc:

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



Subject: threading timeout Linux bug
Date: Wed, 17 Feb 2016 15:36:54 +0000
To: "bug-Net-SFTP-Foreign [...] rt.cpan.org" <bug-Net-SFTP-Foreign [...] rt.cpan.org>
From: "Denley, Chris" <Chris.Denley [...] experian.com>
When Net::SFTP::Foreign is used in Linux from a new thread, the timeout does not work correctly. It does not kill the underlying SSH client which prevents the thread from joining back to the main thread. In fact, it will kill the main thread unless you set an alarm handler. use Net::SFTP::Foreign; use threads; my %args = ( 'user' => 'testuser', 'password' => 'secret', 'host'=> 'hostname', 'timeout' => 10, 'port'=> 22); # without this, main thread dies with "Alarm clock" $SIG{ALRM} = 'a'; # start a thread that will take more than 10 seconds to login my ($t) = threads->create('sftp_thread'); print "Thread started\n"; $t->join(); print "Thread finished\n"; # no problem when not used in separate thread #&sftp_thread; sub sftp_thread { my $sftp = Net::SFTP::Foreign->new(%args); if($sftp->error) { print "Failed to connect: ".$sftp->error."\n"; # workaround #kill "KILL",$sftp->{pid} if($sftp->{pid} =~ /^\d+$/); } else { print "Connected successfully\n"; } }
Download (untitled) / with headers
text/plain 137b
Should be fixed now on the development version 1.84_01: https://metacpan.org/release/SALVA/Net-SFTP-Foreign-1.84_01 Could you try it?
Subject: RE: [rt.cpan.org #112101] threading timeout Linux bug
Date: Thu, 9 Jun 2016 14:21:16 +0000
To: "bug-Net-SFTP-Foreign [...] rt.cpan.org" <bug-Net-SFTP-Foreign [...] rt.cpan.org>
From: "Denley, Chris" <Chris.Denley [...] experian.com>
Download (untitled) / with headers
text/plain 471b
Seems to work as expected. Thanks! Show quoted text
-----Original Message----- From: Salvador Fandino Garcia via RT [mailto:bug-Net-SFTP-Foreign@rt.cpan.org] Sent: Thursday, June 09, 2016 4:15 AM To: Denley, Chris Subject: [rt.cpan.org #112101] threading timeout Linux bug <URL: https://rt.cpan.org/Ticket/Display.html?id=112101 > Should be fixed now on the development version 1.84_01: https://metacpan.org/release/SALVA/Net-SFTP-Foreign-1.84_01 Could you try it?
ok, closing. Thank you for reporting the issue!


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.