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

svn_io_run_cmd running out of file handles, APR bug?

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2002-01-13 05:26:29 CET

Hi

Writing a new test I have been calling svn_io_run_cmd() in a loop,
after a few hundred calls it fails with

apr_error: #24, src_err 0 : <Too many open files>
  run_cmd_in_directory: error setting /usr/bin/cmp process io attributes

Looking in /proc/nnn/fd I see hundreds of pipes.

As far as I can see:

- svn_io_run_cmd() calls apr_procattr_io_set()

  This calls apr_file_pipe_create() to creates three pipes in the
  apr_procattr_t structure.

- svn_io_run_cmd() calls apr_procattr_child_in_set(),
  apr_procattr_child_out_set() and apr_procattr_child_err_set()

  These call apr_file_dup() and overwrite the pipe descriptors.

The result is that the pipe descriptors don't get closed and so
accumulate until the process runs out of resources.

Now even if svn_io_run_cmd() doesn't call apr_procattr_io_set() to
create the pipes, the problem will still occur because the three
functions apr_procattr_child_err_set() et.al. each start by calling
apr_file_pipe_create() themselves if the pipe doesn't exist.

What are these pipes for? It seems silly to create them simply to
close them again. Is this an APR bug?

-- 
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:56 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.