Hello.

This was originally reported in the Trac Open Source Project,
but had not been reported to us by using normal channels.

Current implementation of the wrappers for svn_delta_editor_t and
svn_repos_parse_fns3_t C APIs had some leakage of Python ref-counts:

(1) An edit baton make by delta.make_editor / a parse_fns3 baton
    made by repos.make_parse_fns3 hold a reference of
    editor object / parse_fns3 object and they never release it.
    This was pointed out in the Trac Open Source Project
    ticket #13112[1], #13129[2], and #13356[3].
(2) Wrapper functions of C APIs which drive svn_delta_editor_t
    svn_repos_parse_fns3_t did not care for the references of
    baton items created by Python call back functions when an
    error is occured during proccessing call back of the API.
(3) parse_fns3 driver object and parse_baton can make a circular
    references through the pool cleanup callback registration:
    The pool can never cleanup if the parse_fns3 driver object
    is allocated from the pool.

[1] repository sync with large Subversion repository has memory leaks
    https://trac.edgewall.org/ticket/13112
[2] trac-admin resync leaks memory
    https://trac.edgewall.org/ticket/13129
[3] Subversion pool is destroyed more than once while testing
    trac/versioncontrol/tests/functional.py, comment 6
    https://trac.edgewall.org/ticket/13356#comment:6

To avoid those problems, I re-implemented those API wrapper by using
pure Python object batons, which are visible from Python interpreter.

I'll commit it later.

Cheers,
--
Yasuhito FUTATSUKI <futat...@yf.bsdclub.org>

Reply via email to