[python-ldap] mutex bug in 2.4.4

Malinowski, Adam amalinowski at cgr.harvard.edu
Wed Nov 23 02:16:55 CET 2011


There appears to be a bug in stable 2.4.4 version of python-module when used in multi-threaded python environment.  I haven't found any info on the mailing list about this, so I thought it should be reported.

A different object is used in lock acquire() and release(), which leads to call to release() always fail, also other blocked callers could be stuck forever.  Perhaps the change was never tested in multi-threaded python.

Falling back to using the global module mutex lock seems to fix it.  I suppose the desired behavior is to make sure the shared open ldap handle is used by a single module at a time.

bash-4.1# diff -Nir Lib/ldap/functions-orig.py Lib/ldap/functions.py
<     lock.acquire()
>     #lock.acquire()
>     ldap._ldap_module_lock.acquire()

Adam Malinowski
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ldap/attachments/20111122/e8114379/attachment.html>

More information about the python-ldap mailing list