httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <traw...@gmail.com>
Subject Re: signals under worker mpm?
Date Mon, 29 Nov 2004 20:02:04 GMT
On Mon, 29 Nov 2004 13:24:29 -0500, Stas Bekman <stas@stason.org> wrote:
> Is there some doc explaining the usage of signal handlers under different
> mpms?

No, although I would suggest the following ;)

/* @tip Don't use signals in your own modules.  Apache makes no effort to
 * support modules which use signals.  Module behavior which is dependent
 * on signals can be expected to vary between MPMs or platforms.
 */

> I get SIGALRM working fine under prefork mpm, but not under worker.
>I assume that it traps the signal before the user code's handler runs,

child_main() calls apr_setup_signal_thread(), which ignores all
signals.  I suspect this is what "breaks" SIGALRM for you with worker
MPM.  Try commenting out the call to apr_setup_signal_thread().

If a module doesn't completely isolate its signal use from the MPM, it
may be hard for the module to operate predictably, or for Apache to
make changes to fix its own problems.  What thread are you using to
handle the SIGALRM?  Why not create your own thread and have it sit in
sigwait() for SIGALRM?

*don't rely on MPM-created threads to have a particular signal mask
*don't use MPM-created threads to run handlers or otherwise react to signals

Mime
View raw message