Bug #21751 for Danga-Socket: test hangs on MSWin32
This queue is for tickets about the Danga-Socket CPAN distribution.
Report information
The Basics
People
Owner:
NML [...] cpan.org
Requestors:
CHORNY [...] cpan.org
alexchorny [...] gmail.com
alexchorny [...] gmail.com
Cc:
AdminCc:
BugTracker
Severity:
Critical
Broken in:
- 1.53
- 1.61
Fixed in:
1.62
MIME-Version: | 1.0 |
X-Mailer: | MIME-tools 5.418 (Entity 5.418) |
Content-Disposition: | inline |
Message-Id: | <rt-3.6.HEAD-16826-1163496201-896.21751-0-0@rt.cpan.org> |
Content-Type: | text/plain; charset="utf8" |
Content-Transfer-Encoding: | binary |
From: | Alexandr Ciornii <alexchorny@gmail.com> |
X-RT-Original-Encoding: | utf-8 |
X-RT-Original-Encoding: | utf-8 |
Content-Length: | 20 |
Also hangs on 1.54.
MIME-Version: | 1.0 |
In-Reply-To: | <rt-3.6.HEAD-16826-1163496201-896.21751-0-0@rt.cpan.org> |
X-Mailer: | MIME-tools 5.418 (Entity 5.418) |
Content-Disposition: | inline |
Charset: | utf8 |
References: | <rt-3.6.HEAD-16826-1163496201-896.21751-0-0@rt.cpan.org> |
Message-Id: | <rt-3.6.HEAD-30553-1205079626-57.21751-0-0@rt.cpan.org> |
Content-Type: | text/plain |
Content-Transfer-Encoding: | binary |
X-RT-Original-Encoding: | utf-8 |
X-RT-Original-Encoding: | utf-8 |
Content-Length: | 451 |
I've traced this issue to not being able to set non-blocking sockets.
E.g. 10/event.t has lines like this:
IO::Handle::blocking($sock, 0);
The tests can be made to fail instead of later hanging by just checking
the return value, e.g.:
IO::Handle::blocking($sock, 0) or die "Couldn't set nonblocking
socket: $!";
Alternatively, there do seem to be some ways to do non-blocking sockets
on Win32. See http://www.perlmonks.org/?node_id=529812
MIME-Version: | 1.0 |
In-Reply-To: | <rt-3.6.HEAD-30553-1205079626-57.21751-0-0@rt.cpan.org> |
X-Mailer: | MIME-tools 5.504 (Entity 5.504) |
Content-Disposition: | inline |
X-RT-Interface: | Web |
References: | <rt-3.6.HEAD-16826-1163496201-896.21751-0-0@rt.cpan.org> <rt-3.6.HEAD-30553-1205079626-57.21751-0-0@rt.cpan.org> |
Content-Type: | text/plain; charset="utf-8" |
Message-ID: | <rt-4.0.18-26714-1462272669-1175.21751-0-0@rt.cpan.org> |
Content-Transfer-Encoding: | binary |
X-RT-Original-Encoding: | utf-8 |
X-RT-Encrypt: | 0 |
X-RT-Sign: | 0 |
Content-Length: | 916 |
On Sun Mar 09 12:20:26 2008, DAGOLDEN wrote:
Show quoted text
> I've traced this issue to not being able to set non-blocking sockets.
>
> E.g. 10/event.t has lines like this:
>
> IO::Handle::blocking($sock, 0);
>
> The tests can be made to fail instead of later hanging by just checking
> the return value, e.g.:
>
> IO::Handle::blocking($sock, 0) or die "Couldn't set nonblocking
> socket: $!";
IO::Handle::blocking return previous status and undef in case of failure, so this check should be
defined(IO::Handle::blocking($sock, 0)) || die (Couldn't set nonblocking socket: $!");
Show quoted text
> Alternatively, there do seem to be some ways to do non-blocking sockets
> on Win32. See http://www.perlmonks.org/?node_id=529812
IO::Handle version 1.26 has such implementation, but setting it still fails (error is that this is not a socket). And tests hang on Strawberry 5.22.1 and 5.24.0RC3.
--
Alexandr Ciornii, http://chorny.net
MIME-Version: | 1.0 |
X-Mailer: | MIME-tools 5.504 (Entity 5.504) |
Content-Disposition: | inline |
X-RT-Interface: | Web |
Content-Type: | text/plain; charset="utf-8" |
Message-ID: | <rt-4.0.18-8419-1530135641-888.21751-0-0@rt.cpan.org> |
Content-Transfer-Encoding: | binary |
X-RT-Original-Encoding: | utf-8 |
X-RT-Encrypt: | 0 |
X-RT-Sign: | 0 |
Content-Length: | 1234 |
Here is a fix:
https://github.com/apparentlymart/libdanga-socket-perl/pull/1/commits/7a25b203f8f9a30dce2b1d010eb3b7438b3e6461
Tests on Windows:
https://ci.appveyor.com/project/nponeccFrom 7a25b203f8f9a30dce2b1d010eb3b7438b3e6461 Mon Sep 17 00:00:00 2001
From: Andrii Melnykov <andy.melnikov@gmail.com>
Date: Wed, 27 Jun 2018 23:54:01 +0300
Subject: [PATCH] Fix tests blocking on Windows
---
t/10-events.t | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/10-events.t b/t/10-events.t
index 5ebf5b4..71ed4c5 100644
--- a/t/10-events.t
+++ b/t/10-events.t
@@ -69,9 +69,9 @@ sub new {
LocalPort => $SERVER_PORT,
Proto => 'tcp',
ReuseAddr => 1,
+ Blocking => 0,
);
die "couldn't create socket" unless $ssock;
- IO::Handle::blocking($ssock, 0);
my $self = $class->SUPER::new($ssock);
$self->watch_read(1);
return $self;op/libdanga-socket-perl/build/1.0.5
Tests on Linux (multiple perls):
https://travis-ci.org/nponeccop/libdanga-socket-perl/builds/397531995
The diff is very small indeed:
MIME-Version: | 1.0 |
In-Reply-To: | <rt-4.0.18-26714-1462272669-1175.21751-0-0@rt.cpan.org> |
X-Mailer: | MIME-tools 5.504 (Entity 5.504) |
Content-Disposition: | inline |
X-RT-Interface: | Web |
References: | <rt-3.6.HEAD-16826-1163496201-896.21751-0-0@rt.cpan.org> <rt-3.6.HEAD-30553-1205079626-57.21751-0-0@rt.cpan.org> <rt-4.0.18-26714-1462272669-1175.21751-0-0@rt.cpan.org> |
Content-Type: | text/plain; charset="utf-8" |
Message-ID: | <rt-4.0.18-15748-1571848783-185.21751-0-0@rt.cpan.org> |
Content-Transfer-Encoding: | binary |
X-RT-Original-Encoding: | utf-8 |
RT-Send-CC: | alexchorny@gmail.com |
X-RT-Encrypt: | 0 |
X-RT-Sign: | 0 |
Content-Length: | 1135 |
On Tue May 03 06:51:10 2016, CHORNY wrote:
Show quoted text
> On Sun Mar 09 12:20:26 2008, DAGOLDEN wrote:
>
Can you test https://cpan.metacpan.org/authors/id/N/NM/NML/Danga-Socket-1.62_02-TRIAL.tar.gz to see if it's fixed? I got maintenance rights and will release 1.62 soon.
> > I've traced this issue to not being able to set non-blocking sockets.
> >
> > E.g. 10/event.t has lines like this:
> >
> > IO::Handle::blocking($sock, 0);
> >
> > The tests can be made to fail instead of later hanging by just
> > checking
> > the return value, e.g.:
> >
> > IO::Handle::blocking($sock, 0) or die "Couldn't set nonblocking
> > socket: $!";
>
> IO::Handle::blocking return previous status and undef in case of
> failure, so this check should be
> defined(IO::Handle::blocking($sock, 0)) || die (Couldn't set
> nonblocking socket: $!");
>
> > Alternatively, there do seem to be some ways to do non-blocking
> > sockets
> > on Win32. See http://www.perlmonks.org/?node_id=529812
>
> IO::Handle version 1.26 has such implementation, but setting it still
> fails (error is that this is not a socket). And tests hang on
> Strawberry 5.22.1 and 5.24.0RC3.
This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.
Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.
Time to display: 0.450826 - RT Version 5.0.1
Copyright 1996-2021 »|« Best Practical Solutions, LLC.