You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by jm...@apache.org on 2005/06/02 22:59:47 UTC

svn commit: r179653 - /spamassassin/trunk/lib/Mail/SpamAssassin/SpamdForkScaling.pm

Author: jm
Date: Thu Jun  2 13:59:47 2005
New Revision: 179653

URL: http://svn.apache.org/viewcvs?rev=179653&view=rev
Log:
prefork: there are circumstances where we can lose idle children; allow a way to cope with that

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=179653&r1=179652&r2=179653&view=diff
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/SpamdForkScaling.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/SpamdForkScaling.pm Thu Jun  2 13:59:47 2005
@@ -188,7 +188,7 @@
     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}++;
+      $self->{overloaded} = 1;
     }
     return;
   }
@@ -209,11 +209,15 @@
 
         dbg("prefork: overloaded, immediately telling kid to accept");
         if (!$self->order_idle_child_to_accept()) {
-          # this should not happen
-          warn "prefork: oops! still overloaded?";
+          # this can happen if something is buggy in the child, and
+          # it has to be killed, resulting in no idle kids left
+          warn "prefork: lost idle kids, so still overloaded";
+          $self->{overloaded} = 1;
+        }
+        else {
+          dbg("prefork: no longer overloaded");
+          $self->{overloaded} = 0;
         }
-        dbg("prefork: no longer overloaded");
-        $self->{overloaded} = 0;
       }
     }
   }