httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Bloom <>
Subject Re: cvs commit: httpd-2.0/server listen.c
Date Mon, 13 Aug 2001 04:31:00 GMT
On Sunday 12 August 2001 21:25, wrote:
> rbb         01/08/12 21:25:43
>   Modified:    .        CHANGES
>                server   listen.c
>   Log:
>   Close a major resource leak.  Everytime we had issued a
>   graceful restart, we leaked a socket descriptor.
>   The listening sockets should not be set inheritable, at least
>   not at this point.  We only want some of the httpd children to
>   inherit the socket.  Namely, those that will be actually serving
>   requests.  Any other child process (piped logs), should not be
>   inheriting the sockets.

This is a pretty major resource leak.  We have had this leak for a very
long time, and I am pretty sure that this is a big enough fix (especially
with the APR pools patch), that it should be in the next release.

I am not giving 2.0.23 a -1 for release, but I would like to roll 2.0.24
next week.  I am pretty sure that this patch breaks Windows and
potentially OS/2 and BeOS though.

The problem is how the inherit flag works.  On Unix, we have two 
ways to create child processes, apr_fork and apr_proc_create.  apr_fork
doesn't recognize the inherit flag by design.  apr_proc_create does.
So, by not setting this to be inheritable, we get it in the child servers,
but not the piped loggers.  I have no idea how to fix this on other platforms,
so I leave that to people who have access to those platforms.

One option would be to set the socket as non-inheritable, and then before
creating the child servers, re-set it to inheritable.  This would require
walking the listener list however.

The only other big bug that we definately have to fix, is the CGI bug that
Doug posted earlier today.  Once that is fixed, I will roll 2.0.24.

Ryan Bloom               
Covalent Technologies

View raw message