http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5388
------- Additional Comments From [EMAIL PROTECTED] 2007-03-27 12:12 -------
hmm.
@@ -178,10 +178,11 @@
foreach my $p (@pids) {
if ($l > $p) { $l = $p };
}
- $self->{lowest_idle_pid} = $l;
+ $self->{lowest_idle_pid} = $l if defined $l;
+ # make sure not to auto-vivify lowest_idle_pid, so the parent knows no child
has ever gone idle.
dbg("prefork: new lowest idle kid: ".
- ($self->{lowest_idle_pid} ? $self->{lowest_idle_pid} : 'none'));
+ ((exists $self->{lowest_idle_pid} && $self->{lowest_idle_pid}) ?
$self->{lowest_idle_pid} : 'none'));
}
If lowest_idle_pid is set to a value, then this is called and no child is idle,
the *previous* value will *be left intact*. that's a bad idea, since that
child probably isn't idle anymore....
@@ -296,7 +297,8 @@
if (!$self->order_idle_child_to_accept()) {
# dbg("prefork: no idle kids, noting overloaded");
# there are no idle kids! we're overloaded, mark that
- $self->{overloaded} = 1;
+ # Don't mark the server as overloaded if no child has ever gone idle.
+ $self->{overloaded} = 1 if exists $self->{lowest_idle_pid};
}
return;
}
So if the spamd server accepts a connection before any of the initial
children reports "idle", it starts another child? I'm inclined
to consider that a feature, to be honest ;) if load is that high,
another child is probably going to be needed.
@@ -532,7 +534,7 @@
chomp $line;
if (index ($line, "P") == 0) { # string starts with "P" = ping
dbg("prefork: periodic ping from spamd parent");
- next;
+ return PF_PING_ORDER;
}
if (index ($line, "A") == 0) { # string starts with "A" = accept
return PFORDER_ACCEPT;
Index: spamd/spamd.raw
===================================================================
--- spamd/spamd.raw (revision 522978)
+++ spamd/spamd.raw (working copy)
@@ -1059,7 +1059,12 @@
if ($scaling) {
$scaling->update_child_status_idle();
$orders = $scaling->wait_for_orders(); # and sleep...
-
+
+ if ($orders eq PF_PING_ORDER) {
+ $i--; #don't count this connection against the max; it's just a ping.
+ next;
+ }
+
if ($orders != PFORDER_ACCEPT) {
info("spamd: unknown order: $orders");
}
I don't get this either. AFAICS this just defers the skipping of the
ping request, up a level in the function call tree, and a few no-ops
later.
@@ -1165,7 +1170,7 @@
}
# Bah!
- if ( !$client ) {
+ if ( !$client || !$client->connected() ) {
# this can happen when interrupted by SIGCHLD on Solaris,
# perl 5.8.0, and some other platforms with -m.
OK, on the other hand, I'm happy to apply this change! It's in trunk now.
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.