Skip Menu |

This queue is for tickets about the Net-Server CPAN distribution.

Report information
The Basics
Id: 21271
Status: resolved
Priority: 0/
Queue: Net-Server

People
Owner: Nobody in particular
Requestors: carlos.velasco [...] nimastelecom.com
Cc:
AdminCc:

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



Subject: [Patch] Prefork - When killing a child "waiting" value in tally is wrongly decreased 2 times
Date: Fri, 01 Sep 2006 22:21:03 +0200
To: bug-Net-Server [...] rt.cpan.org
From: Carlos Velasco <carlos.velasco [...] nimastelecom.com>
Hello, In Preform module, when killing a process throug HUP, waiting value in tally is decreased 2 times. I think the superfluous line is in kill_n_children. Here is a patch. diff -ur Net-Server-0.94/lib/Net/Server/PreFork.pm Net-Server-0.94_patched/lib/Net/Server/PreFork.pm --- Net-Server-0.94/lib/Net/Server/PreFork.pm 2006-07-12 04:46:30.000000000 +0200 +++ Net-Server-0.94_patched/lib/Net/Server/PreFork.pm 2006-09-01 22:16:24.000000000 +0200 @@ -161,7 +161,8 @@ next unless $prop->{children}->{$_}->{status} eq 'waiting'; $n --; - $prop->{tally}->{waiting} --; + # HUP register_sig in run_parent already does that + #$prop->{tally}->{waiting} --; ### try to kill the child kill('HUP',$_) or $self->delete_child( $_ ); Regards, Carlos Velasco
The patched code now looks like: foreach (keys %{ $prop->{children} }){ next unless $prop->{children}->{$_}->{status} eq 'waiting'; $n--; ### try to kill the child if (! kill('HUP',$_)) { $prop->{tally}->{waiting}--; $self->delete_child( $_ ); } last if $n <= 0; } It will be in version 0.95 released in a few days. Thanks. Paul