Hi all,
I'm running on linux with perl 5.8.8, poe 0.3501 and component...XMLRPC
0.05.
If I have a runtime error in my code, POE goes into a loop (recursion it
appears) where it eats up all the memory on the box and with logging
enabled it generates the following line again and again..
<ss> stopping session 5 (POE::Session=ARRAY(0x9ff1cd0)) at
/hilton/lib/perl5/site_perl/5.8.8/POE/Resource/Sessions.pm line 4575 ->
_stop (from hilton/lib/perl5/site_perl/5.8.8/POE/Resource/Sessions.pm at
484)
<ss> stopping session 5 (POE::Session=ARRAY(0x9ff1cd0)) at
/hilton/lib/perl5/site_perl/5.8.8/POE/Resource/Sessions.pm line 4575 ->
_stop (from hilton/lib/perl5/site_perl/5.8.8/POE/Resource/Sessions.pm at
484)
I have the following test code that can reproduce it, can anyone
confirm if it's a perl 5.8 or poe problem? We just moved to 5.8 and the
latest POE (it's a new box and we wanted to start from scratch). It
doesn't appear to happen on some real old poe and perl 5.6.
there are 2 files, Foo and FooTst, run the Foo as nohup Foo & and then
the FooTst will cause the problem.
thanks for any help,
bob maccione
------------------------------------------------------------------------
------------------------------------------------------------------------
-----------------------
#!/usr/bin/perl -w -I .
use strict;
sub POE::Kernel::ASSERT_DEFAULT () { 1 }
sub POE::Kernel::TRACE_SESSIONS () { 1 }
use POE;
use POE::Component::Server::XMLRPC;
#
# load up context and enable the Debug/Logging, etc.
#
Init();
Main();
=item Init()
Do the one time stuff here..
=cut
sub Init {
Startup( 9191 );
}
=item Main()
Do the fancy main processing here..
=cut
sub Main {
$poe_kernel->run;
exit 0;
}
=item Startup()
This is called once from the main Init routine and is used to get the
ball rolli
ng.
input:
port - the port to listen on
returns:
nothin
=cut
sub Startup {
my $port = shift;
print STDERR "Startup: port $port\n";
POE::Component::Server::XMLRPC->new( alias => "xmlrpc", port => 'dev'
);
POE::Session->create
( inline_states =>
{ _start => \&SetupService,
_stop => \&ShutdownService,
# our stuff..
Test => \&Test,
},
options => { trace => 1, debug => 1 },
);
#
# we're done in the init stage for now
}
=item SetupService()
Start the listening service. You need to add a post for each txn you'll
want to support
=cut
sub SetupService {
my $kernel = $_[KERNEL];
print STDERR "SetupService\n";
# set all of the services
$kernel->post( xmlrpc => publish => dev => "Test" );
print STDERR "SetupService Done\n";
}
=item ShutDownService()
Stop the xmlrpc service
=cut
sub ShutDownService {
print STDERR "ShutdownService\n";
# unset all of the services
$_[KERNEL]->post( xmlrpc => rescind => dev => "Ngt" );
$_[KERNEL]->post( xmlrpc => rescind => dev => "Ping" );
$_[KERNEL]->post( xmlrpc => rescind => dev => "Search" );
$_[KERNEL]->post( xmlrpc => rescind => dev => "Test" );
print STDERR "ShutdownService Done\n";
}
=item Test()
Simple Test txn
=cut
sub Test {
my $transaction = $_[ARG0];
my $params = $transaction->params();
print STDERR "Running test routine\n";
$params->Foo();
$transaction->return( "Pong" );
}
------------------------------------------------------------------------
------------------------------------------------------------------------
-----------------------
this is the test code
------------------------------------------------------------------------
------------------------------------------------------------------------
-----------------------
#!/usr/bin/perl -w
# send in a ping txn to the listener
use strict;
use Debug;
use Data::Dumper;
use XMLRPC::Lite;
my $name = 'http://localhost:9191/xmlrpc';
my $txn = 'Ping';
print XMLRPC::Lite
-> proxy('http://localhost:9191/?session=dev')
-> Test()
-> result
;
------------------------------------------------------------------------
------------------------------------------------------------------------
-----------------------