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

Re: Why does SVN + apache try to close non existing file descriptors?

From: Marc Haisenko <haisenko_at_comdasys.com>
Date: Wed, 12 Mar 2008 15:50:15 +0100

On Wednesday 12 March 2008, Jon Bendtsen wrote:
> Q) why brute force close all files?
> a) ask the kernel to close all my open files
> b) ask the kernel which files do I have open and then close only those
> c) remember what files i have open and then close only those

This problem may sound easy but is quite tricky to solve: there's no portable
solution for a) and b), and c) is not reliable. For example, on Linux I think
there's no way for a), and b) would most likely have to rely on
analyzing /proc/*/fd. But this won't work on systems like FreeBSD or Mac OS X
which don't have /proc.

This is why several UNIX applications do the brute force way. But it may be a
good idea to limit it. It's highly unlikely that SubVersion would have more
than say 128 file handles open, with a safety factor let's make that 1024. If
by chance there really ARE more than 1024 file descriptors open you propably
have bigger problems than not having all file descriptors closed ;-)

Marc

-- 
Marc Haisenko
Comdasys AG
Rüdesheimer Str. 7
80686 München
Germany
Tel.: +49 (0)89 548 433 321
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-03-12 15:50:44 CET

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

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