Subject: | RPC::XML::Server dies on simultaneous requests for slow methods |
Date: | Mon, 1 Feb 2010 12:14:02 +0000 |
To: | bug-RPC-XML [...] rt.cpan.org |
From: | Robert Goliasz <robert.goliasz [...] uk.clara.net> |
How to reproduce:
1. use this as the server:
#! /usr/bin/perl
use strict;
use warnings;
use RPC::XML::Server;
my $srv = RPC::XML::Server->new(port => 9000);
$srv->add_method({
name => 'test',
signature => [ 'string' ],
code => \&mysub
});
$srv->server_loop();
print "this is never executed\n";
sub mysub {
my ($server) = @_;
sleep 10;
return 'foo';
}
# (PERL CODE ENDS HERE)
2. Using a simple xml client, send a request for method 'test'
3. Hit control-C on that client quickly
4. Start another identical xml request in a new instance of the simple
xml client (you have to do it all within 10 seconds since the first
request)
5. Wait 10 seconds to see the second client receive a 500 read failed:
Connection reset by peer, and the xml-rpc server die. The print
statement below the server_loop() never gets executed, it's also not
possible to trap this in an eval around server_loop().
Tested with Perl 5.10.0 and RPC::XML::Server version 1.48.
--
Robert Goliasz
Core Development Team Leader
Claranet Limited
21 Southampton Row
London, WC1B 5HA
Tel: +44 (0) 20 7685 8062
Email: robert.goliasz@uk.clara.net
Web: www.clara.net
Company registration: 3152737 place of registration: England
All the information contained within this electronic message from
Claranet Ltd is covered by the disclaimer at
http://www.uk.clara.net/disclaimer