Skip Menu |
 

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

Report information
The Basics
Id: 82685
Status: resolved
Priority: 0/
Queue: POE-Component-IKC

People
Owner: Nobody in particular
Requestors: rohit.nitk2004 [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.2302
Fixed in: (no value)



Subject: Possible issue with pre-forked POE IKC Server implementation
Download (untitled) / with headers
text/plain 1.3k
Distribution name : POE-Component-IKC-0.2302 Perl Version : 5.10.1 OS : GNU/Linux 2.6.18 issue: while using pre-fork functionality of POE IKC Server; we see that POE Children stop entertaining further connection requests as soon as they are done with first connection request per child. analysis: by commenting the call to '_select_define' in 'else' part; this issue gets resolved as we shouldn't stop accepting further connection requests. Please advise if our understanding is indeed correct and this needs a fix Attached is a client server example which simulates this behavior by spawning 2 children to server 10 connections per child. However; client calls start failing after 2 attempts as each child; after serving the first connection; stops accepting further connection requests <=Server Logs => $./IKCServer.pl Initializing 7464: Created Tue Jan 8 22:38:28 2013 7463: Babysiting 2 children 7464, 7465 7465: Created Tue Jan 8 22:38:28 2013 7463: Telling everyone we are the parent 7464: 9 connections left Got a ping request from client 7465: 9 connections left Got a ping request from client <=Client Logs=> $ ./IKCClient.pl calling remote Server Got a response back $./IKCClient.pl calling remote Server Got a response back $ ./IKCClient.pl POE connection failed:Timeout connecting to zzzzzzzzzzz:12367 at ./IKCClient.pl line 11.
Subject: IKCServer.pl
Download IKCServer.pl
text/x-perl 1k
#!/tp64/perl/5.10.1/bin/perl use strict; use warnings; use Sys::Hostname; use POE; use POE::Component::IKC::Server; my $SERVER_HOST = hostname; my $SERVER_PORT = 12367; POE::Component::IKC::Server->spawn( ip => $SERVER_HOST, port => $SERVER_PORT, name => 'IKCServer', processes => 3, connections => 10, babysit => 900, verbose =>1 , ); POE::Session->create( inline_states => { _start => \&init, _stop => \&cleanUp, pingMe => \&pingMe, } ); POE::Kernel->run(); exit 0; sub init { my $kernel = $_[KERNEL]; my $service_name = 'IKCServer'; print STDERR "Initializing\n"; $kernel->alias_set($service_name); $kernel->post(IKC => publish => $service_name,['pingMe']); return 1; } sub cleanUp { my $kernel = $_[KERNEL]; print STDERR "Shutting Down!!!\n"; $kernel->call( IKC => 'shutdown' ); return 1; } sub pingMe { my ( $kernel, $heap, $request ) = @_[ KERNEL, HEAP, ARG0 ]; my ( $args, $rsvp ) = @$request; print STDERR "Got a ping request from client\n"; $kernel->call( IKC => post => $rsvp, 1 ); return 1; }
Subject: IKCClient.pl
Download IKCClient.pl
text/x-perl 536b
#!/tp64/perl/5.10.1/bin/perl use strict; use warnings; use Sys::Hostname; use POE::Component::IKC::ClientLite; my $SERVER_HOST = hostname; my $SERVER_PORT = 12367; my $remoteClient = create_ikc_client( ip => $SERVER_HOST, port => $SERVER_PORT, name => "Client-$$", ) or die "POE connection failed:".POE::Component::IKC::ClientLite::error(); print STDERR "calling remote Server\n"; my $ret = $remoteClient->post_respond('IKCServer/pingMe') or die "POE call failed:".$remoteClient->error; print STDERR "Got a response back\n";
Download (untitled) / with headers
text/plain 574b
On Mon Jan 14 02:15:26 2013, rbhardwaj wrote: Show quoted text
> analysis: by commenting the call to '_select_define' in 'else' part; > this issue gets resolved as we shouldn't stop accepting further > connection requests.
If you are referring to like 613, then yes, your analysis is exactly correct. That line is a mistake. The _select_define() is handled by concurrency_up() a few lines previous. I didn't catch the bug because I always have concurrency=1, where you use the default concurrency of 0 (infinite). Thank you for the heads up. Patched version shall be uploaded. Soon.
Fixed in 0.2303.
No answer, so I assume the patch worked.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.