pgsql: Rewrite async-connection loop in libpqwalreceiver.c, once again.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Rewrite async-connection loop in libpqwalreceiver.c, once again.
Date: 2017-03-15 17:26:31
Message-ID: E1coCgx-0001yY-Vv@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Rewrite async-connection loop in libpqwalreceiver.c, once again.

The original coding in commit 1e8a85009 didn't use PQconnectPoll per
spec, and while the rewrite in e434ad39a is closer, it still doesn't
guarantee to wait until the socket is read-ready or write-ready (as
appropriate) before calling PQconnectPoll. It's not clear whether
that omission is causing the continuing failures on buildfarm member
bowerbird; but given the lack of other explanations meeting the
available facts, let's tighten that up and see what happens.

An independent issue in the same loop was that it had a race condition
whereby it could clear the process's latch without having serviced an
interrupt request, causing failure to respond to a cancel while waiting
for connection (the very problem 1e8a85009 was meant to fix).

Discussion: https://postgr.es/m/7295.1489596949@sss.pgh.pa.us

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/b5dd50f2c0ad8edcc3145aabe18788d448bf940d

Modified Files
--------------
.../libpqwalreceiver/libpqwalreceiver.c | 60 +++++++++++-----------
1 file changed, 30 insertions(+), 30 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Andres Freund 2017-03-15 17:40:03 Re: [COMMITTERS] pgsql: Improve isolation tests infrastructure.
Previous Message Tom Lane 2017-03-15 16:55:49 Re: [COMMITTERS] pgsql: Use asynchronous connect API in libpqwalreceiver