httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Manoj Kasichainula <>
Subject Poll-accept graceful child shutdown in apache-apr
Date Thu, 15 Apr 1999 08:37:26 GMT
Here is a patch that implements graceful shutdown of a child process
for the hybrid server. It actually changes a few things:

- As Dean suggested, it adds a pipe which the poll call waits on. We
  send a byte down the pipe when we want the child process to wake up
  and die.

  There is a distinct disadvantage to this though. Now, even if we're
  only serving a single socket, we have to call poll() before we can
  call accept(). But, I don't see a way to kick threads out of
  accept() without signals, which are indeed evil.

- It loops when the poll() call returns EINTR. There's a warning in
  the code saying this shouldn't be done, but I don't understand why,
  unless this is a peculiar thing that applies to select and not poll.

- It adds other machinery needed to get the process to exit properly
  upon receiving a SIGWINCH or hitting MaxRequestsPerChild
Thoughts? I'm mainly wondering whether this patch is correct, or if
there is a more efficient way to do this. It seems to work (including
for the multisocket case that Tani Hosokawa was dealing with).


View raw message