Re: [GENERAL] Deadlock in libpq

2011-03-26 Thread Erik Hesselink
On Fri, Mar 25, 2011 at 21:21, Merlin Moncure wrote: > On Fri, Mar 25, 2011 at 3:26 AM, Erik Hesselink wrote: >>> hm, ISTM (I don't know haskell) that the hdbc driver isn't doing any >>> type of synchronization at all unless it is using a non thread safe >>> libpq...and in that case it uses a glo

Re: [GENERAL] Deadlock in libpq

2011-03-25 Thread Merlin Moncure
On Fri, Mar 25, 2011 at 3:26 AM, Erik Hesselink wrote: >> hm, ISTM (I don't know haskell) that the hdbc driver isn't doing any >> type of synchronization at all unless it is using a non thread safe >> libpq...and in that case it uses a global mutex.  That doesn't look >> correct -- the hdbc driver

Re: [GENERAL] Deadlock in libpq

2011-03-25 Thread Erik Hesselink
On Thu, Mar 24, 2011 at 20:38, Merlin Moncure wrote: > On Thu, Mar 24, 2011 at 11:57 AM, Merlin Moncure wrote: >> On Thu, Mar 24, 2011 at 11:52 AM, Merlin Moncure wrote: As far as connections getting dropped: yes, this sounds reasonable, but given that both the client and the server ar

Re: [GENERAL] Deadlock in libpq

2011-03-24 Thread Merlin Moncure
On Thu, Mar 24, 2011 at 11:57 AM, Merlin Moncure wrote: > On Thu, Mar 24, 2011 at 11:52 AM, Merlin Moncure wrote: >>> As far as connections getting dropped: yes, this sounds reasonable, >>> but given that both the client and the server are running on the same >>> machine, will connections (to 127

Re: [GENERAL] Deadlock in libpq

2011-03-24 Thread Merlin Moncure
On Thu, Mar 24, 2011 at 11:52 AM, Merlin Moncure wrote: >> As far as connections getting dropped: yes, this sounds reasonable, >> but given that both the client and the server are running on the same >> machine, will connections (to 127.0.0.1) really be dropped once every >> 100.000 or so? > > No,

Re: [GENERAL] Deadlock in libpq

2011-03-24 Thread Merlin Moncure
On Thu, Mar 24, 2011 at 11:27 AM, Erik Hesselink wrote: > On Thu, Mar 24, 2011 at 17:18, Merlin Moncure wrote: >> On Thu, Mar 24, 2011 at 10:54 AM, Erik Hesselink wrote: >>> On Thu, Mar 24, 2011 at 16:43, Merlin Moncure wrote: He needs to rule out the most obvious problem first -- PQInitSS

Re: [GENERAL] Deadlock in libpq

2011-03-24 Thread Erik Hesselink
On Thu, Mar 24, 2011 at 17:18, Merlin Moncure wrote: > On Thu, Mar 24, 2011 at 10:54 AM, Erik Hesselink wrote: >> On Thu, Mar 24, 2011 at 16:43, Merlin Moncure wrote: >>> He needs to rule out the most obvious problem first -- PQInitSSL being >>> called improperly or at the wrong time.  OP: It's

Re: [GENERAL] Deadlock in libpq

2011-03-24 Thread Merlin Moncure
On Thu, Mar 24, 2011 at 10:54 AM, Erik Hesselink wrote: > On Thu, Mar 24, 2011 at 16:43, Merlin Moncure wrote: >> He needs to rule out the most obvious problem first -- PQInitSSL being >> called improperly or at the wrong time.  OP: It's a library wide >> setting and must be called before the fir

Re: [GENERAL] Deadlock in libpq

2011-03-24 Thread Erik Hesselink
On Thu, Mar 24, 2011 at 16:43, Merlin Moncure wrote: > He needs to rule out the most obvious problem first -- PQInitSSL being > called improperly or at the wrong time.  OP: It's a library wide > setting and must be called before the first connection is established > and only once.  Perhaps the HDB

Re: [GENERAL] Deadlock in libpq

2011-03-24 Thread Merlin Moncure
On Thu, Mar 24, 2011 at 10:00 AM, Tom Lane wrote: > Merlin Moncure 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

Re: [GENERAL] Deadlock in libpq

2011-03-24 Thread Erik Hesselink
On Thu, Mar 24, 2011 at 16:00, Tom Lane wrote: > Merlin Moncure 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

Re: [GENERAL] Deadlock in libpq

2011-03-24 Thread Tom Lane
Merlin Moncure 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

Re: [GENERAL] Deadlock in libpq

2011-03-24 Thread Erik Hesselink
On Thu, Mar 24, 2011 at 15:21, Merlin Moncure wrote: > On Thu, Mar 24, 2011 at 9:07 AM, Erik Hesselink wrote: >> On Thu, Mar 24, 2011 at 14:23, Merlin Moncure wrote: >>> On Thu, Mar 24, 2011 at 4:17 AM, Erik Hesselink wrote: Hi, We're getting a deadlock in our application (a web

Re: [GENERAL] Deadlock in libpq

2011-03-24 Thread Merlin Moncure
On Thu, Mar 24, 2011 at 9:07 AM, Erik Hesselink wrote: > On Thu, Mar 24, 2011 at 14:23, Merlin Moncure wrote: >> On Thu, Mar 24, 2011 at 4:17 AM, Erik Hesselink wrote: >>> Hi, >>> >>> We're getting a deadlock in our application (a web application with a >>> PostgreSQL backend) which I've traced

Re: [GENERAL] Deadlock in libpq

2011-03-24 Thread Erik Hesselink
On Thu, Mar 24, 2011 at 14:23, Merlin Moncure wrote: > On Thu, Mar 24, 2011 at 4:17 AM, Erik Hesselink wrote: >> Hi, >> >> We're getting a deadlock in our application (a web application with a >> PostgreSQL backend) which I've traced to libpq. I've started our >> application in gdb, and when it h

Re: [GENERAL] Deadlock in libpq

2011-03-24 Thread Merlin Moncure
On Thu, Mar 24, 2011 at 4:17 AM, Erik Hesselink wrote: > Hi, > > We're getting a deadlock in our application (a web application with a > PostgreSQL backend) which I've traced to libpq. I've started our > application in gdb, and when it hangs, I've inspected the backtraces. > I've found a couple of

[GENERAL] Deadlock in libpq

2011-03-24 Thread Erik Hesselink
Hi, We're getting a deadlock in our application (a web application with a PostgreSQL backend) which I've traced to libpq. I've started our application in gdb, and when it hangs, I've inspected the backtraces. I've found a couple of threads I can account for (listening for new connections, backgrou