Mailing List Archive

svn commit: r191624 - /spamassassin/trunk/lib/Mail/SpamAssassin/SpamdForkScaling.pm
Author: jm
Date: Mon Jun 20 22:39:14 2005
New Revision: 191624

URL: http://svn.apache.org/viewcvs?rev=191624&view=rev
Log:
bug 4410: explicitly forget the backchannel between spamd master and children if a child exits, in prefork mode

Modified:
spamassassin/trunk/lib/Mail/SpamAssassin/SpamdForkScaling.pm

Modified: spamassassin/trunk/lib/Mail/SpamAssassin/SpamdForkScaling.pm
URL: http://svn.apache.org/viewcvs/spamassassin/trunk/lib/Mail/SpamAssassin/SpamdForkScaling.pm?rev=191624&r1=191623&r2=191624&view=diff
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/SpamdForkScaling.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/SpamdForkScaling.pm Mon Jun 20 22:39:14 2005
@@ -99,10 +99,18 @@
$self->set_child_state ($pid, PFSTATE_STARTING);
}

+# this is called by the SIGCHLD handler in spamd. The idea is that
+# main_ping_kids etc. can mark a child as probably dead ("K" state), but until
+# SIGCHLD is received, the process is still around (in some form), so it
+# shouldn't be removed from the list until it's confirmed dead.
+#
sub child_exited {
my ($self, $pid) = @_;

delete $self->{kids}->{$pid};
+
+ # remove the child from the backchannel list, too
+ $self->{backchannel}->delete_socket_for_child($pid);

# ensure we recompute, so that we don't try to tell that child to
# accept a request, only to find that it's died in the meantime.