You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by David James <dj...@collab.net> on 2006/01/29 06:15:01 UTC

[PATCH] Prevent race conditions during application pool initialization in Python bindings

Currently, if two separate mod_python interpreters attempt to create
an application pool at the same time, the Python bindings will fail
and throw an exception. This problem was reported by W-Mark Kubacki on
the users list <http://svn.haxx.se/users/archive-2005-12/0569.shtml>,
and corroborated by other Trac users on the Trac issue tracker
<http://projects.edgewall.com/trac/ticket/2611>.

To fix this problem, I've written a patch which uses a Python
threading lock to ensure that only one thread initializes an
application_pool at a time. Subversion developers, please take a look
at this patch and let me know whether you think it will help.

[[[
Use a Python threading lock to ensure that only one thread initializes
the application_pool. This fix prevents race conditions during
application pool initialization.

* subversion/bindings/swig/include/proxy_apr.swg
  (application_pool_lock): New lock.
  (apr_pool_t.set_parent_pool): Lock application_pool_lock before
  accessing or modifying the application_pool.
]]]

Cheers,

David

P.S. I haven't been able to reproduce this mod_python threading issue
yet on a uniprocessor RHEL4 machine. Perhaps folks who have
multiprocessor machines will have better luck reproducing the issue?


--
David James -- http://www.cs.toronto.edu/~james