httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Jagielski <>
Subject Re: [PATCH] pool confusion (take 1)
Date Sun, 09 Nov 1997 15:28:44 GMT
Dean Gaudet wrote:
> The current code has two related bugs:
>     - flock doesn't seem to be cleaning up its file on
> 	SIGTERM under Linux

The current base assumes that accept_mutex_cleanup will be called
"when appropriate" and remove the lockfile. Of course, a kill -9
would prevent that from happening, so the lockfile would still
exist. However, the parent process is careful to unlink the
lockfile when it starts up and then "immediately" open() it.

> We've overloaded pconf with the last two of those.  This just won't work;
> there are cleanups that need to be done exactly once (i.e. unlinking
> the scoreboard, or the flock file, or deleting the sysvsem).  Right now
> we hack around that by listing a bunch of crud at the exit() point of
> the parent.  This is silly, we have the concept of a cleanup built into
> pools, we should be able to use it.
> This patch creates "pool *pchild;", which has the second meaning above.
> "pconf" is cleaned up only by the parent.  It removes various cleanup
> definitions in the mutex and scoreboard code, and replaces them with
> register_cleanup() calls as appropriate (which simplifies other code).
> It attempts to destroy_pool(pchild) or destroy_pool(pconf) at the
> appropriate moments.

I really like the concept... A quick look at the code looks cool
too. In essense, it looks like we are creating our own atexit()
function, which I think modules would like as well.
      Jim Jagielski            |       jaguNET Access Services           |
            "Look at me! I'm wearing a cardboard belt!"

View raw message