Skip Menu |

This queue is for tickets about the POE-Component-Client-Keepalive CPAN distribution.

Report information
The Basics
Id: 92985
Status: resolved
Priority: 0/
Queue: POE-Component-Client-Keepalive

People
Owner: Nobody in particular
Requestors: sfx.main [...] gmail.com
Cc:
AdminCc:

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



Subject: 'Not an ARRAY reference' error in sub _ka_shutdown
I think there is a bug in sub _ka_shutdown at line 923. Code: # Stop any pending resolver requests. foreach my $host (keys %{$heap->{resolve}}) { DEBUG and warn "SHT: Shutting down resolver requests for $host"; foreach my $request (@{$heap->{resolve}{$host}}) { $self->_shutdown_request($kernel, $request); } # Technically not needed since the resolver shutdown should do it. $self->[SF_RESOLVER]->cancel( $heap->{resolve}->[0]->[RQ_RESOLVER_ID] ); } I think in last line must be '$heap->{resolve}->{$host}' instead '$heap->{resolve}->[0]'.
Thanks for the bug report. I released what I think is the right fix. commit 96d92a6c75eefdc3fd701c7af9a3255e1f446de5 Author: Rocco Caputo <rcaputo@cpan.org> Date: Tue Jul 8 13:45:54 2014 -0400 rt.cpan.org 92985. Ideally resolve "Not an ARRAY reference" at shutdown. I haven't encountered the problem myself, but I see where it could happen, thanks to the bug report. This change should fix it, but I haven't got a test case, so no absolute guarantees are made. diff --git a/lib/POE/Component/Client/Keepalive.pm b/lib/POE/Component/Client/Keepalive.pm index 48e2eea..1138ade 100644 --- a/lib/POE/Component/Client/Keepalive.pm +++ b/lib/POE/Component/Client/Keepalive.pm @@ -926,7 +926,11 @@ sub _ka_shutdown { } # Technically not needed since the resolver shutdown should do it. - $self->[SF_RESOLVER]->cancel( $heap->{dns_requests}[0][RQ_RESOLVER_ID] ); + # They all share the same host, so canceling the first should get + # them all. + $self->[SF_RESOLVER]->cancel( + $heap->{dns_requests}{$host}[0][RQ_RESOLVER_ID] + ); } $heap->{dns_requests} = { };