From ler@lerctr.org  Mon Nov  6 15:18:31 2006
Return-Path: <ler@lerctr.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 6E93516A4E9
	for <FreeBSD-gnats-submit@freebsd.org>; Mon,  6 Nov 2006 15:18:31 +0000 (UTC)
	(envelope-from ler@lerctr.org)
Received: from thebighonker.lerctr.org (thebighonker.lerctr.org [192.147.25.65])
	by mx1.FreeBSD.org (Postfix) with ESMTP id CC17043DED
	for <FreeBSD-gnats-submit@freebsd.org>; Mon,  6 Nov 2006 15:15:41 +0000 (GMT)
	(envelope-from ler@lerctr.org)
Received: from ler by thebighonker.lerctr.org with local (Exim 4.63 (FreeBSD))
	(envelope-from <ler@lerctr.org>)
	id 1Gh6CK-0005HX-Ua
	for FreeBSD-gnats-submit@freebsd.org; Mon, 06 Nov 2006 09:15:40 -0600
Message-Id: <E1Gh6CK-0005HX-Ua@thebighonker.lerctr.org>
Date: Mon, 06 Nov 2006 09:15:40 -0600
From: Larry Rosenman <ler@lerctr.org>
Reply-To: Larry Rosenman <ler@lerctr.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: mail/p5-Mail-SpamAssassin: Dies occasionally: prefork: ordered...
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         105213
>Category:       ports
>Synopsis:       mail/p5-Mail-SpamAssassin: Dies occasionally: prefork: ordered...
>Confidential:   no
>Severity:       non-critical
>Priority:       high
>Responsible:    clsung
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Nov 06 15:20:27 GMT 2006
>Closed-Date:    Tue Nov 07 03:34:59 GMT 2006
>Last-Modified:  Tue Nov  7 03:40:12 GMT 2006
>Originator:     Larry Rosenman
>Release:        FreeBSD 6.2-PRERELEASE amd64
>Organization:
LERCTR Consulting
>Environment:
System: FreeBSD thebighonker.lerctr.org 6.2-PRERELEASE FreeBSD 6.2-PRERELEASE #80: Sat Nov 4 20:57:14 CST 2006 root@thebighonker.lerctr.org:/usr/obj/usr/src/sys/THEBIGHONKER amd64


>Description:
spamd will occasionally die with "prefork: ordered child to accept, but child reported state '1'.

The SA guys have a bug opened (4594), and it's been going on for a while. 

They have a patch, which seems to fix it at:
http://issues.apache.org/SpamAssassin/attachment.cgi?id=3713&action=view
(I've added the patch below, but the link is better if the MTA's mangle
it).



Can we get this patch into the port?
>How-To-Repeat:
It's very spotty.  I can go weeks without seeing it, then see tons of it in
a short time. 

>Fix:

Index: lib/Mail/SpamAssassin/SpamdForkScaling.pm
===================================================================
--- lib/Mail/SpamAssassin/SpamdForkScaling.pm	(revision 462907)
+++ lib/Mail/SpamAssassin/SpamdForkScaling.pm	(working copy)
@@ -426,7 +426,13 @@
     dbg("prefork: ordered $kid to accept");
 
     # now wait for it to say it's done that
-    return $self->wait_for_child_to_accept($sock);
+    my $ret = $self->wait_for_child_to_accept($kid, $sock);
+    if ($ret) {
+      return $ret;
+    } else {
+      # retry with another child
+      return $self->order_idle_child_to_accept();
+    }
 
   }
   else {
@@ -436,10 +442,11 @@
 }
 
 sub wait_for_child_to_accept {
-  my ($self, $sock) = @_;
+  my ($self, $kid, $sock) = @_;
 
   while (1) {
     my $state = $self->read_one_message_from_child_socket($sock);
+
     if ($state == PFSTATE_BUSY) {
       return 1;     # 1 == success
     }
@@ -447,7 +454,12 @@
       return undef;
     }
     else {
-      die "prefork: ordered child to accept, but child reported state '$state'";
+      warn "prefork: ordered child $kid to accept, but they reported state '$state', killing rogue";
+      $self->child_error_kill($kid, $sock);
+      $self->adapt_num_children();
+      sleep 1;
+
+      return undef;
     }
   }
 }
@@ -479,6 +491,8 @@
 
 sub update_child_status_busy {
   my ($self) = @_;
+
+# if (rand 4 < 1) { $self->report_backchannel_socket("I".pack("N",$self->{pid})."\n");return; warn "TEST for bug 4594"; die; }
   # "B  b1 b2 b3 b4 \n "
   $self->report_backchannel_socket("B".pack("N",$self->{pid})."\n");
 }

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->perl 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Mon Nov 6 15:22:26 UTC 2006 
Responsible-Changed-Why:  
Over to maintainer 

http://www.freebsd.org/cgi/query-pr.cgi?pr=105213 
Responsible-Changed-From-To: perl->clsung 
Responsible-Changed-By: clsung 
Responsible-Changed-When: Tue Nov 7 03:10:50 UTC 2006 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=105213 
State-Changed-From-To: open->closed 
State-Changed-By: clsung 
State-Changed-When: Tue Nov 7 03:34:57 UTC 2006 
State-Changed-Why:  
Committed. Thank You. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=105213 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/105213: commit references a PR
Date: Tue,  7 Nov 2006 03:34:50 +0000 (UTC)

 clsung      2006-11-07 03:34:43 UTC
 
   FreeBSD ports repository
 
   Modified files:
     mail/p5-Mail-SpamAssassin Makefile 
   Added files:
     mail/p5-Mail-SpamAssassin/files 
                                     patch-lib-Mail-SpamAssassin-SpamdForkScaling.pm 
   Log:
   - fix the [Bug 4594]
     http://issues.apache.org/SpamAssassin/show_bug.cgi?id=4594
   - bump PORTREVISION
   
   PR:             ports/105213
   Submitted by:   Larry Rosenman <ler_AT_lerctr dot org>
   
   Revision  Changes    Path
   1.99      +1 -0      ports/mail/p5-Mail-SpamAssassin/Makefile
   1.1       +53 -0     ports/mail/p5-Mail-SpamAssassin/files/patch-lib-Mail-SpamAssassin-SpamdForkScaling.pm (new)
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
