Skip Menu | 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

Owner: Nobody in particular
Requestors: Chris.Denley [...]

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 [...]" <bug-Net-SFTP-Foreign [...]>
From: "Denley, Chris" <Chris.Denley [...]>
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: Could you try it?
Subject: RE: [ #112101] threading timeout Linux bug
Date: Thu, 9 Jun 2016 14:21:16 +0000
To: "bug-Net-SFTP-Foreign [...]" <bug-Net-SFTP-Foreign [...]>
From: "Denley, Chris" <Chris.Denley [...]>
Download (untitled) / with headers
text/plain 471b
Seems to work as expected. Thanks! Show quoted text
-----Original Message----- From: Salvador Fandino Garcia via RT [] Sent: Thursday, June 09, 2016 4:15 AM To: Denley, Chris Subject: [ #112101] threading timeout Linux bug <URL: > Should be fixed now on the development version 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 infrastructure.

Please report any issues with to