Re: [HACKERS] libpqrcv_PQexec() seems to violate latch protocol

2017-06-06 Thread Petr Jelinek
On 06/06/17 23:42, Andres Freund wrote: > On 2017-06-06 23:24:50 +0200, Petr Jelinek wrote: >> On 06/06/17 23:17, Andres Freund wrote: >>> Right. I found a couple more instance of similarly iffy, although not >>> quite as broken, patterns in launcher.c. It's easy to get this wrong, >>> but it's a

Re: [HACKERS] libpqrcv_PQexec() seems to violate latch protocol

2017-06-06 Thread Andres Freund
On 2017-06-06 23:24:50 +0200, Petr Jelinek wrote: > On 06/06/17 23:17, Andres Freund wrote: > > Right. I found a couple more instance of similarly iffy, although not > > quite as broken, patterns in launcher.c. It's easy to get this wrong, > > but it's a lot easy if you do it differently everywhe

Re: [HACKERS] libpqrcv_PQexec() seems to violate latch protocol

2017-06-06 Thread Petr Jelinek
On 06/06/17 23:17, Andres Freund wrote: > On 2017-06-06 17:14:59 -0400, Tom Lane wrote: >> Andres Freund writes: >>> The function in $subject does: >> >>> ResetLatch(&MyProc->procLatch); >>> rc = WaitLatchOrSocket(&MyProc->procLatch, >>>

Re: [HACKERS] libpqrcv_PQexec() seems to violate latch protocol

2017-06-06 Thread Andres Freund
On 2017-06-06 17:14:59 -0400, Tom Lane wrote: > Andres Freund writes: > > The function in $subject does: > > > ResetLatch(&MyProc->procLatch); > > rc = WaitLatchOrSocket(&MyProc->procLatch, > >WL_POSTMASTER_DEATH | WL_SOCKET_READABLE >

Re: [HACKERS] libpqrcv_PQexec() seems to violate latch protocol

2017-06-06 Thread Tom Lane
Andres Freund writes: > The function in $subject does: > ResetLatch(&MyProc->procLatch); > rc = WaitLatchOrSocket(&MyProc->procLatch, >WL_POSTMASTER_DEATH | WL_SOCKET_READABLE | >WL_LATCH_SET, >

[HACKERS] libpqrcv_PQexec() seems to violate latch protocol

2017-06-06 Thread Andres Freund
Hi, The function in $subject does: while (PQisBusy(streamConn)) { int rc; /* * We don't need to break down the sleep into smaller increments, * since we'll get interrupted by signals and can either handle * in