httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Douglass <>
Subject Re: Oh sod it
Date Wed, 26 Jun 1996 15:30:21 GMT
On Tue, 25 Jun 1996, Ben Laurie wrote:

> > How about sending the children a single which is *never* blocked, and
> > whose sole effect is to set a flag which makes them stop accepting new
> > connections?  (I think I called this the "time_to_die" flag in a previous
> > note on this general subject...).
> The problem is that a signal will interrupt any system call in progress. I
> haven't looked to see how well they are protected but I imagine that not all of
> them are. The cool way to deal with this is to block the signal everywhere
> except where you want to receive it.
> Of course, there is an interesting race condidition between where the signal
> is unblocked and the blocking system call, but I guess in we can live with it
> in this context (though I do have a cute fix if needed).

Ok, so what you are trying to do is to tell these children (after HUP to the
main server, or some similar signal) to stop serving after the current
connection?  And signals seem a little unstable across platforms?  Ok, how
about having the children agree upon some file's existance for continued
server operations.  In between serving documents, stat the file and act
accordingly.  This might not be practicle; but in my experience stating a
file has never put a very large lag on a server process.  Furthermore, I
do believe that this particular method would be a "stable" (reliable)
method for cross platforms without having to worry about signals and
interrupted system calls, and blocking/unblocking/race conditions.

When you send the "restart" signal to the main server touch(or remove
depending on which logic you take to the file) the "stop" file, reread
the config and choose a new "stop" file for the new children.

Just a thought; consider it thinking out fingers?

Michael Douglass
Texas Networking, Inc.

  "To be a saint is to be an exception; to be a true man is the rule.
   Err, fail, sin if you must, but be upright.  To sin as little as
   possible is the law for men; to sin not at all is a dream for angels."

              - Victor Hugo, "Les Miserables"

View raw message