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

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

From: David James <djames_at_collab.net>
Date: 2006-01-29 07:15:01 CET

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

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.



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

To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Received on Sun Jan 29 07:15:31 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.