httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Bloom <...@raleigh.ibm.com>
Subject fix for hybrid server problems.
Date Mon, 26 Apr 1999 20:22:51 GMT

I am prefacing this with "This is a twisted solution, but it works VERY
reliably."  This is a solution that comes from a couple of different
people within IBM, and I am summarizing it here.

We have a number of problems in the hybrid server that all have to do with
shutting down the server.

1) Can't break out of fcntl without a signal.
2) can't break out of select easily.
3) We could use pipes to break out of select, but as far as I can tell,
you can't use select with pipes on Windows NT(95|98?????)
4) We have threads serving requests that we can't kill in non-graceful
shutdown cases.
5) If we are handling a graceful shutdown, we ignore non-graceful shutdown
requests until we are done.  (Manoj says he knows how to solve this one.)
6) Inter- and Intr- process locking seems to be interfering with each
other.

The solution:
All threads accept SIGWINCH(graceful) and SIGHUP(non-graceful).  When a
thread gets either signal, it sets it's spot in the scoreboard, masks that
signal to SIG_IGN, checks to see if there are any more active threads, and
if so, re-sends the signal to it's own process.

Basically, if we have N threads in each process, we send the signal N
times to make sure that all of our threads are dying off properly.

The problems with this solution:
1) We end up relying on signals in the children.  We didn't want to do
this.
2) We have to put back in all of the block and unblock alarms code.
This would be more annoying than anything else.

The plusses to doing this:
1) If we abstract out the signal call in APR, this could be VERY portable.
2) It is garaunteed to work, everytime.
3) It mimics what 1.3 does now, so we know it is a viable solution.
4) It allows us to support non-threaded OS's easier, because all OS's,
whether they have threading or not have their children handling shutdown
the same way.
5) It also allows a -T option (single threaded, for debuggin
purposes)(same as #4)
6) It solves all of our current problems with shutdown.

Okay, I am ready for the flames that this solution should bring my way.
Please, be gentle.

Ryan

_______________________________________________________________________
Ryan Bloom		rbb@raleigh.ibm.com
4205 S Miami Blvd	
RTP, NC 27709		It's a beautiful sight to see good dancers 
			doing simple steps.  It's a painful sight to
			see beginners doing complicated patterns.	



Mime
View raw message