httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Stein <>
Subject Re: fix for hybrid server problems.
Date Tue, 04 May 1999 07:31:32 GMT
Dean Gaudet wrote:
> On Tue, 4 May 1999, Manoj Kasichainula wrote:
> > Can we rely on close() or shutdown() getting rid of our listening
> > sockets while we're selecting on them?
> The event thread is where we learn that we're supposed to do a graceful
> shutdown... so it's trivial to make sure we don't select on them.
> Unfortunately we may need to either spawn a new thread to do call the
> graceful shutdown methods, or we'll have to require the graceful shutdown
> methods to be non-blocking.  Hmm.

Nah. Just have a third item type in the request queue: "run graceful
shutdown methods". When the response comes back, the event thread can
die off.

Right after the event thread throws that request into the queue, it can
also place N "thread shutdown" requests into the queue. Each thread pops
that off the queue, cleans itself up, decrements some semaphore, and
terminates itself. (the event thread would block on this semaphore,
waiting for all child threads to die before really dying)

Maybe the ordering and details in there aren't quite right, but it seems
like a start.

(for example, you may need to wait for all activity to stop before
placing the graceful-shutdown request into the queue)

> > > graceful restart and graceful shutdown are the two suggested forms
> > > of restarting and shutting down the server.  They're the safe forms.
> >
> > If we solve the above problem (and log rotation), this sounds
> > reasonable.  Do we mind that there will be no way to get a mod_status
> > display of our gracefully dying children after a graceful shutdown?
> Didn't think about that... hmm.

I would think that the modules wouldn't receive the graceful shutdown
until they were done with their activity. In that case, the shutdown
shouldn't take very long. It seems that you'd have a relatively narrow
window where mod_status wouldn't work for the server.

(I mean really... you *are* telling the thing to shutdown/restart... why
shouldn't it be allowed to punt your request for a while in there?  Did
I miss something? This seems a pretty easy point here)


Greg Stein,

View raw message