You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spamassassin.apache.org by bu...@bugzilla.spamassassin.org on 2010/03/15 14:59:17 UTC

[Bug 6377] New: win32: spamd signal handling

https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6377

           Summary: win32: spamd signal handling
           Product: Spamassassin
           Version: SVN Trunk (Latest Devel Version)
          Platform: Other
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P5
         Component: spamc/spamd
        AssignedTo: dev@spamassassin.apache.org
        ReportedBy: lemke@jam-software.com


Created an attachment (id=4713)
 --> (https://issues.apache.org/SpamAssassin/attachment.cgi?id=4713)
signal handling for spamd under win32

Ok some last minor changes and I stop bothering you (for now) ;)

I had to disable the SIG{USR2} since this is another signal which isn't
supported under windows. This is not a big issue but it throws a warning for
every start of spamd:

warn: No such signal: SIGUSR2 at [...]


Beside this, windows isn't able to handle SIGCHLD, this is a more serious
problem since a child isn't able to exit properly (however, spamd is working
while not reaching its maximum children):

warn: prefork: kill of child -364 failed: Invalid argument


To make sure the children can exit properly, we have to send our windows kill
signal (kill QUIT => 0) for each unix kill 'like' signal. (see sub
setup_child_sig_handlers())


I tested this changes with the latest SVN Trunk and it was working well.

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6377] win32: spamd signal handling

Posted by bu...@bugzilla.spamassassin.org.
https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6377

Justin Mason <jm...@jmason.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jm@jmason.org

--- Comment #3 from Justin Mason <jm...@jmason.org> 2010-03-16 09:48:49 UTC ---
hmm.  a POSIX SIGKILL signal is uncatchable.  are you sure that's what you
want?  maybe a SIGTERM would be better?

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6377] win32: spamd signal handling

Posted by bu...@bugzilla.spamassassin.org.
https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6377

Daniel <le...@jam-software.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #4713|0                           |1
        is obsolete|                            |

--- Comment #2 from Daniel <le...@jam-software.com> 2010-03-16 08:48:42 UTC ---
Created an attachment (id=4714)
 --> (https://issues.apache.org/SpamAssassin/attachment.cgi?id=4714)
updated patch for win32 spamd signal handling

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6377] [review] win32: spamd signal handling

Posted by bu...@bugzilla.spamassassin.org.
https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6377

--- Comment #9 from Kevin A. McGrail <km...@pccc.com> 2011-05-05 19:54:05 UTC ---
(In reply to comment #8)
> > Apart from some minor stylistic changes to the proposed patch,
> > I added status checking and reporting (info) on sending SIGINT,
> > and one change at around line 1006 in spamd.raw, on which I have
> > a question (for Unix people, not for Daniel/Windows): is there
> > any reason not to call child_handler() unconditionally, even
> > if $scaling is true and the machine is not running Windows?
> > If there are no processes to be reaped, the waitpid bails out
> > immediately.
> 
> Calling child_handler every once in a while even if it is
> also attached to a signal handler may help to reap a child
> process whose SIGCHLD may have been missed in a time gap
> between exiting the while loop in child_handler and exiting
> a signal handler, so - I think it does no harm, and it may
> do some good on a rare occasion. Putting it to a review state.

+1 KAM

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6377] [review] win32: spamd signal handling

Posted by bu...@bugzilla.spamassassin.org.
https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6377

Mark Martinec <Ma...@ijs.si> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Status Whiteboard|needs 2 votes               |needs 1 vote

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6377] win32: spamd signal handling

Posted by bu...@issues.apache.org.
https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6377

Mark Martinec <Ma...@ijs.si> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #4714|0                           |1
        is obsolete|                            |

--- Comment #7 from Mark Martinec <Ma...@ijs.si> 2010-06-04 09:29:51 EDT ---
Created an attachment (id=4770)
 --> (https://issues.apache.org/SpamAssassin/attachment.cgi?id=4770)
Mostly stylistic changes to the proposed patch

trunk:
  Bug 6377: win32: spamd signal handling
Sending spamd/spamd.raw
Committed revision 951403.

Apart from some minor stylistic changes to the proposed patch,
I added status checking and reporting (info) on sending SIGINT,
and one change at around line 1006 in spamd.raw, on which I have
a question (for Unix people, not for Daniel/Windows): is there
any reason not to call child_handler() unconditionally, even
if $scaling is true and the machine is not running Windows?
If there are no processes to be reaped, the waitpid bails out
immediately.

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6377] [review] win32: spamd signal handling

Posted by bu...@bugzilla.spamassassin.org.
https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6377

Henrik Krohns <he...@hege.li> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hege@hege.li
  Status Whiteboard|needs 1 vote                |ready to commit for 3.3.2

--- Comment #10 from Henrik Krohns <he...@hege.li> 2011-05-08 13:23:51 UTC ---
+1 for what's in the trunk

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6377] win32: spamd signal handling

Posted by bu...@issues.apache.org.
https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6377

--- Comment #8 from Mark Martinec <Ma...@ijs.si> 2010-06-08 08:28:05 EDT ---
> Apart from some minor stylistic changes to the proposed patch,
> I added status checking and reporting (info) on sending SIGINT,
> and one change at around line 1006 in spamd.raw, on which I have
> a question (for Unix people, not for Daniel/Windows): is there
> any reason not to call child_handler() unconditionally, even
> if $scaling is true and the machine is not running Windows?
> If there are no processes to be reaped, the waitpid bails out
> immediately.

Calling child_handler every once in a while even if it is
also attached to a signal handler may help to reap a child
process whose SIGCHLD may have been missed in a time gap
between exiting the while loop in child_handler and exiting
a signal handler, so - I think it does no harm, and it may
do some good on a rare occasion. Putting it to a review state.

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6377] win32: spamd signal handling

Posted by bu...@issues.apache.org.
https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6377

Stefan <q0...@cuba.ionum.ch> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |q0011@cuba.ionum.ch

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6377] win32: spamd signal handling

Posted by bu...@bugzilla.spamassassin.org.
https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6377

Mark Martinec <Ma...@ijs.si> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P5                          |P3
   Target Milestone|Undefined                   |3.3.2

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6377] win32: spamd signal handling

Posted by bu...@bugzilla.spamassassin.org.
https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6377

Daniel <le...@jam-software.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lemke@jam-software.com

--- Comment #1 from Daniel <le...@jam-software.com> 2010-03-16 08:46:06 UTC ---
Added windows KILL signal to sub kill_handler to make sure, spamd can shut down
properly.

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6377] [review] win32: spamd signal handling

Posted by bu...@issues.apache.org.
https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6377

Mark Martinec <Ma...@ijs.si> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|win32: spamd signal         |[review] win32: spamd
                   |handling                    |signal handling
  Status Whiteboard|                            |needs 2 votes

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6377] win32: spamd signal handling

Posted by bu...@issues.apache.org.
https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6377

--- Comment #5 from Stefan <q0...@cuba.ionum.ch> 2010-04-30 10:38:51 EDT ---
i patched 3.3.1 spamd with patch from bug 6375, 6376, 6377 and can confirm that
patched is working with activestate perl 5.10.1. without patch from bug 6377
spamd crashes when decreasing number of children.

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6377] win32: spamd signal handling

Posted by bu...@issues.apache.org.
https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6377

Kevin A. McGrail <km...@pccc.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kmcgrail@pccc.com

--- Comment #6 from Kevin A. McGrail <km...@pccc.com> 2010-05-31 18:19:53 EDT ---
(In reply to comment #5)
> i patched 3.3.1 spamd with patch from bug 6375, 6376, 6377 and can confirm that
> patched is working with activestate perl 5.10.1. without patch from bug 6377
> spamd crashes when decreasing number of children.

I have not tested on windows but the logic seems specific to windows.  I'm +1
though I don't know how the CLA is handled for the patch.

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6377] [review] win32: spamd signal handling

Posted by bu...@bugzilla.spamassassin.org.
https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6377

Mark Martinec <Ma...@ijs.si> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #11 from Mark Martinec <Ma...@ijs.si> 2011-05-08 21:24:29 UTC ---
3.3:
  Bug 6377: win32: spamd signal handling
  Sending spamd/spamd.raw
Committed revision 1100820.

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6377] win32: spamd signal handling

Posted by bu...@issues.apache.org.
https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6377

Mark Martinec <Ma...@ijs.si> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6377] win32: spamd signal handling

Posted by bu...@bugzilla.spamassassin.org.
https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6377

--- Comment #4 from Daniel <le...@jam-software.com> 2010-03-16 10:42:02 UTC ---
Kill was the only thing that worked for me. Any other signal caused the shut
down process to hang up.

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.