[PyGreSQL] [patch] relinquish GIL while connecting to database

Peter Schuller peter.schuller at infidyne.com
Mon Sep 22 08:36:19 EDT 2008


> > Attached is a patch that inserts Py_BEGIN_ALLOW_THREADS /
> > Py_END_ALLOW_THREADS before/after the connection attempts.
> 
> +1 for checking this in.

I discovered today that on Debian sarge (yes I know, massively old)
this patch actually does cause problems when libpq is built with krb5
support.

It uses krb5 in a non-threadsafe fashion (such as in fe-auth.c). In
modern versions of libpq there is additional locking, and there are
comments specifically mentioning that it is needed for krb5.

The end-result is sporadic segfaults.

I have not investigated exactly as of which version of libpq this
should be fixed, but the sarge version is 7.4.7.

IMO it may be worth mentioning this in the ChangeLog, though to me it
does not feel like a reason to not make the change.

-- 
/ Peter Schuller

PGP userID: 0xE9758B7D or 'Peter Schuller <peter.schuller at infidyne.com>'
Key retrieval: Send an E-Mail to getpgpkey at scode.org
E-Mail: peter.schuller at infidyne.com Web: http://www.scode.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
Url : http://mailman.vex.net/pipermail/pygresql/attachments/20080922/9b6fa0a0/attachment.pgp 


More information about the PyGreSQL mailing list