You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Ryan Bloom <rb...@covalent.net> on 2002/03/19 01:30:37 UTC

Do graceful restarts actually work anywhere?

Just looking through the code and graceful restarts really shouldn't be
working right now.  The problem is that we pass pconf into the pre_mpm
phase, but on Unix we only call the pre_mpm phase on graceless shutdown
or when the server first starts.  We clear the pconf pool on every
restart, and we register a cleanup with pconf to destroy the scoreboard.

If I have traced the code correctly, this means that we should be
deleting the scoreboard on every graceful restart and not re-creating
it.  I can't see how this is not causing severe seg faults.

Also, Windows is calling ap_pre_mpm on every restart, and I believe that
the correct solution is to pass pglobal to the pre_mpm hook.

Ryan

----------------------------------------------
Ryan Bloom                  rbb@covalent.net
645 Howard St.              rbb@apache.org
San Francisco, CA 



RE: Do graceful restarts actually work anywhere?

Posted by Ryan Bloom <rb...@covalent.net>.
> "Ryan Bloom" <rb...@covalent.net> writes:
> 
> > Just looking through the code and graceful restarts really shouldn't
be
> > working right now.  The problem is that we pass pconf into the
pre_mpm
> > phase, but on Unix we only call the pre_mpm phase on graceless
shutdown
> > or when the server first starts.  We clear the pconf pool on every
> > restart, and we register a cleanup with pconf to destroy the
scoreboard.
> >
> > If I have traced the code correctly, this means that we should be
> > deleting the scoreboard on every graceful restart and not
re-creating
> > it.  I can't see how this is not causing severe seg faults.
> 
> Perhaps you missed this line?
> 
>   apr_pool_cleanup_kill(pconf, NULL, ap_cleanup_scoreboard);
> 
> Graceful restarts for prefork are working properly as far as I can
> tell.
> 
> Graceful restarts for worker have at least the following problem:

YES!  I missed that line.  Why don't we just pass pglobal to the pre_mpm
phase.

Ryan



Re: Do graceful restarts actually work anywhere?

Posted by Jeff Trawick <tr...@attglobal.net>.
"Ryan Bloom" <rb...@covalent.net> writes:

> Just looking through the code and graceful restarts really shouldn't be
> working right now.  The problem is that we pass pconf into the pre_mpm
> phase, but on Unix we only call the pre_mpm phase on graceless shutdown
> or when the server first starts.  We clear the pconf pool on every
> restart, and we register a cleanup with pconf to destroy the scoreboard.
> 
> If I have traced the code correctly, this means that we should be
> deleting the scoreboard on every graceful restart and not re-creating
> it.  I can't see how this is not causing severe seg faults.

Perhaps you missed this line?

  apr_pool_cleanup_kill(pconf, NULL, ap_cleanup_scoreboard);

Graceful restarts for prefork are working properly as far as I can
tell.

Graceful restarts for worker have at least the following problem:

. we potentially leave accepted connections in the queue between the
  listener thread and the worker threads

In neither MPM do we *seem* to have a scoreboard problem.

But something uncool is going on with mod_cgid.  Occasionally today I
was able to end up with two daemons.  I have punted on the cgid issue
while playing with the worker problem mentioned above.  Something
that still bothers me is cgid's lack of a SIGHUP handler.  I'd rather
see the daemon set up a handler for SIGHUP which sets a flag which is
checked in the main cgid loop.  It is (usually) dying now on SIGHUP,
but I wonder if our SIGHUP handler changes based on whether it is
initial startup (MPM didn't get a chance to run yet?) or after a
restart (MPM had registered a SIGHUP handler on the previous
generation which is inherited in the cgid child process).  More
playing required.

-- 
Jeff Trawick | trawick@attglobal.net
Born in Roswell... married an alien...