Skip Menu |

This queue is for tickets about the RPC-XML CPAN distribution.

Report information
The Basics
Id: 54183
Status: resolved
Priority: 0/
Queue: RPC-XML

People
Owner: rjray [...] blackperl.com
Requestors: robert.goliasz [...] uk.clara.net
Cc:
AdminCc:

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



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
Subject: Re: [rt.cpan.org #54183] AutoReply: RPC::XML::Server dies on simultaneous requests for slow methods
Date: Mon, 1 Feb 2010 12:30:04 +0000
To: Bugs in RPC-XML via RT <bug-RPC-XML [...] rt.cpan.org>
From: Robert Goliasz <robert.goliasz [...] uk.clara.net>
I have just also tested it on the following versions: perl 5.8.7 + RPC::XML::Server 1.44 perl 5.10.0 + RPC::XML::Server 1.54 perl 5.10.1 + RPC::XML::Server 1.54 The behaviour is always the same (it keeps dying). Also note I was testing on i686 machines in 32-bit mode. -- 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
Subject: Re: [rt.cpan.org #54183] AutoReply: RPC::XML::Server dies on simultaneous requests for slow methods
Date: Mon, 1 Feb 2010 13:50:19 +0000
To: Bugs in RPC-XML via RT <bug-RPC-XML [...] rt.cpan.org>
From: Robert Goliasz <robert.goliasz [...] uk.clara.net>
It gets killed by SIGPIPE when it tries to write to a dead client. Putting a dummy SIGPIPE handler in your script works it around: $SIG{PIPE} = sub { print "got SIGPIPE\n" }; I'm not sure where the pipe handler should live... But it's definitely worth mentioning in documentation that this might happen. -- 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
Fixed, with a specific test-file added to the suite of tests to exercise this. -- """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Randy J. Ray Silicon Valley Scale Modelers: http://www.svsm.org rjray@blackperl.com randy.j.ray@gmail.com