Skip Menu |

This queue is for tickets about the IO-Async CPAN distribution.

Report information
The Basics
Id: 102677
Status: resolved
Priority: 0/
Queue: IO-Async

People
Owner: Nobody in particular
Requestors: leonerd-cpan [...] leonerd.org.uk
Cc:
AdminCc:

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



Subject: Default behavior of Listener on accept failures is wrong
By default, all accept failures are silently ignored. This makes such failures as accept(...) = -1 # EMFILE particularly disasterous, because the loop will just immediately try to accept() again in the next IO round, leading to 100% CPU spins. -- Paul Evans
Fixed. -- Paul Evans
Subject: rt102677.patch
=== modified file 'lib/IO/Async/Listener.pm' --- lib/IO/Async/Listener.pm 2015-04-04 12:33:27 +0000 +++ lib/IO/Async/Listener.pm 2015-04-04 12:40:09 +0000 @@ -128,7 +128,7 @@ Optional. Invoked if the C<accept> syscall indicates an error (other than C<EAGAIN> or C<EWOULDBLOCK>). If not provided, failures of C<accept> will -simply be ignored. +be passed to the main C<on_error> handler. =cut @@ -295,7 +295,8 @@ $on_done->( $self, $result ); })->on_fail( sub { my ( $message, undef, $socket, $dollarbang ) = @_; - $self->maybe_invoke_event( on_accept_error => $socket, $dollarbang ); + $self->maybe_invoke_event( on_accept_error => $socket, $dollarbang ) or + $self->invoke_error( "accept() failed - $dollarbang", accept => $socket, $dollarbang ); }); # Caller is not going to keep hold of the Future, so we have to ensure it
Released in 0.66 -- Paul Evans