[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: cvs commit: httpd-2.0 STATUS

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2002-01-25 15:27:53 CET

Justin Erenkrantz <jerenkrantz@ebuilt.com> writes:

> On Fri, Jan 25, 2002 at 02:23:37AM -0000, jerenkrantz@apache.org wrote:
> > jerenkrantz 02/01/24 18:23:37
> >
> > Modified: . STATUS
> > Log:
> > showstoppers--;
> >
> > APR knows when to let go of those pesty kids now.
>
> If you were getting bit by the APR pipe leakage (either in mod_cgid
> in httpd-2.0 or svn_run_io_cmd in SVN), please try again.
>
> One of my servers filled up its / partition with a 10GB error_log
> complaining that mod_cgid was out of file descriptors. With my
> dup2 change to APR in proc.c, mod_cgid doesn't seem to leak fds
> per request.

It's better, but I don't think it's perfect.

The functions that cause the problem are apr_procattr_child_in_set,
apr_procattr_child_out_set and apr_procattr_child_err_set. These all
create a pipe, resulting in two open file descriptors in APR's private
apr_procattr_t structure. Each function accepts two file arguments and
uses these to dup2 the pipe file descriptors. Thus there are still two
open file descriptors in the apr_procattr_t structure.

Now when apr_proc_create is called the parent process closes one of
the file descriptors for each pipe, but not the other. These other
file descriptor remain open and since they are only available to the
APR library the application cannot close them directly.

The troublesome file descriptors get closed when their associated pool
is destroyed, so the application can use a pool with a suitable
lifetime to control the lifetime of the file descriptors. While this
is possible, it looks like a less than optimum interface for APR to
present.

-- 
Philip
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:59 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.