Re: Deadlock in libpq - Mailing list pgsql-general

From Erik Hesselink
Subject Re: Deadlock in libpq
Date
Msg-id AANLkTi=njN3rFDr6b8opSXB=JFbxjANtupdvkBQo=EUH@mail.gmail.com
Whole thread Raw
In response to Re: Deadlock in libpq  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Thu, Mar 24, 2011 at 16:00, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Merlin Moncure <mmoncure@gmail.com> writes:
>> *something* must be initializing ssl, or you can't make secure
>> connections from libpq.  you need to find out which pq ssl init
>> function is begin called, when it is being called, and with what
>> arguments. One of the main things PQInitSSL does is set up a lock
>> vector which it passes to the crypto library.  The fact you are having
>> blocking issues around those locks is suggesting SSL was not set up
>> properly, something happened after being set up so that the locks are
>> no longer good, you have application thread issue (although that
>> sounds unlikely), or (least likely worst case) there is a bug in
>> crypto.
>
> Given that Erik still sees trouble when not using SSL, my money would
> be on the idea that somewhere he's got two threads trying to use the
> same connection object concurrently.  The SSL confusion is just one
> symptom of that.

I've just looked at all the spots in the code where I fork a new
thread, and nowhere do I share a connection between threads. I've also
checked the source for HDBC-postgresql, and it also creates a new
connection each time I ask it to (i.e. no caching/pooling etc) by
calling PQconnectdb. So I'm pretty sure I'm not sharing a connection
between two threads. This is a web application, so there is pretty
good isolation between different threads (almost no shared state).

--
Erik Hesselink
http://silkapp.com

pgsql-general by date:

Previous
From: raghu ram
Date:
Subject: Re: [ADMIN] What does error "psql: Kerberos 5 authentication not supported" means?
Next
From: Merlin Moncure
Date:
Subject: Re: Deadlock in libpq