Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: EXC [...] cpan.org
Cc:
AdminCc:

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



Subject: Loosing initial pings for the same host when Parallelism > 1
Loosing of pings in the initial phase occurs when special conditions are meet: * Pings are send to the same host * Parallelism is more or equal to 2 for POE::Component::Client::Ping * Al least 2 ping events are created in a row (initial pings) The number of lost pings: min( Parallelism, initial pings ) - 1. The attachment demonstrates the issue.
Subject: ping.pl
#!/usr/bin/env perl use strict; use warnings; use POE qw( Component::Client::Ping ); POE::Component::Client::Ping->spawn( Parallelism => 3 ); POE::Session->create( inline_states => { _start => sub { $_[HEAP]->{hosts} = [ '127.0.0.1', '127.0.0.1', '127.0.0.1', '127.0.0.1', '127.0.0.1' ]; $_[KERNEL]->yield( 'ping' ) for (1..3); }, _stop => sub { print $_[HEAP]->{ok}, "\n"; }, ping => sub { $_[KERNEL]->post( 'pinger', 'ping', 'pong', $_ ) if $_ = shift @{ $_[HEAP]->{hosts} }; }, pong => sub { $_[HEAP]->{ok}++ if defined $_[ARG1]->[0]; $_[KERNEL]->yield( 'ping' ); }, }, ); POE::Kernel->run; # Loosing of pings in the initial phase occurs when special conditions are meet: # # * Pings are send to the same host # * Parallelism is more or equal to 2 for POE::Component::Client::Ping # * Al least 2 ping events are created in a row (initial pings) # # The number of lost pings: min( Parallelism, initial pings ) - 1.
Resolved in ae5ac39a7e28ee679260570b023a0cd8d5257cba ... but perhaps not the way you expected. Documented behavior is for duplicate pings from the same session, for the same host, to cancel previous ones. Your test should produce N-1 timeouts and 1 success.