Hello,

I've been working on an full text search plugin for Trac. At initial setup this 
indexes the entire Subversion repository by reading every node of every 
version. During testing we discovered that the indexer was running out of file 
handles, due to a file handle leak. As far as I can tell each 
core.Stream(fs.file_contents(.)) instance that was created and not subsequently 
.read() left an unclosed file handle. To work around this I have monkey patched 
a Stream.close() method that calls svn_stream_close, which is used in a 
try/finally block. 

The work-around has fixed our file-handle leak for, but I believe it points to 
a bug in the Subversion bindings for which I'll try and provide a patch. Before 
I file a bug I'd like to check I haven't misunderstood anything:
1. In the Python bindings core.Stream doesn't have a .close() method [a]. Is 
there any reason this might be intentional?
2. Disregarding Python, in the Subversion library is it required that every 
svn_stream_t created (by eg a call to svn_fs_file_contents) is explicitly 
closed, or is there some automatic clean-up/closure provided by the pool system?
 
With thanks, Alex

[a] 
http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/python/svn/core.py?revision=1303375&view=markup#l202
-- 
Alex Willmer | Developer
2 Trinity Park,  Birmingham, B37 7ES | United Kingdom 
M: +44 7557 752744
al.will...@logica.com | www.logica.com
Logica UK Ltd, registered in UK (registered number 947968)
Registered Office: 250 Brook Drive, Green Park, Reading RG2 6UA, United Kingdom


Think green - keep it on the screen.

This e-mail and any attachment is for authorised use by the intended 
recipient(s) only. It may contain proprietary material, confidential 
information and/or be subject to legal privilege. It should not be copied, 
disclosed to, retained or used by, any other party. If you are not an intended 
recipient then please promptly delete this e-mail and any attachment and all 
copies and inform the sender. Thank you.


Reply via email to