httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <traw...@gmail.com>
Subject Re: Bug: Apache hangs if script invokes fork/waitpid
Date Fri, 08 Oct 2004 15:31:32 GMT
On Thu, 07 Oct 2004 12:53:47 -0700, Paul Querna <chip@force-elite.com> wrote:
> Jeff Trawick wrote:
> > I think there needs to be a mod_fork which provides a more general
> > purpose daemon than that used by mod_cgid, and some Apache API will
> > know whether or not to send a request over there.  This preserves the
> > goal of having fork() called only by single-threaded processes so that
> > all manner of pain is avoided.
> 
> Big +1 from me in concept.
> 
> I am not sure how to do the implementation best.  mod_cgid doesn't
> really 'fork' in the sense most programs do, its mostly just starting up
> a cgi process -- from an executable on the file system.
> 
> This seems drastically different from the requirements of a generic fork().
> 
> Any thoughts on how you would want to implement this in a generic manner
> for any call from anywhere for any module?

it has to be extremely restricted; the obvious capability is to allow
apr_proc_create() to be called, with pipes set up properly back to
code running in the Apache thread; another possible service is to
allow a new child to be created and then in that process call some
specified function which was copied into the mod_fork daemon process
at apache startup; maybe that code happens to be some part of mod_perl
which can implement suitable services on behalf of a perl script

I suspect that whatever restrictions on applications are necessary to
implement such a service are the same restrictions which must be
respected anyway in order to have an application which works
reliably+portably in a threaded MPM.

Mime
View raw message