Re: [HACKERS] [COMMITTERS] pgsql: Use asynchronous connect API inlibpqwalreceiver - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: [HACKERS] [COMMITTERS] pgsql: Use asynchronous connect API inlibpqwalreceiver
Date
Msg-id dcef4616-21af-5ec0-4113-d409e5ddbf86@2ndquadrant.com
Whole thread Raw
In response to Re: [HACKERS] [COMMITTERS] pgsql: Use asynchronous connect API inlibpqwalreceiver  (Petr Jelinek <petr.jelinek@2ndquadrant.com>)
Responses Re: [HACKERS] [COMMITTERS] pgsql: Use asynchronous connect API inlibpqwalreceiver  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
List pgsql-hackers
On 3/4/17 01:45, Petr Jelinek wrote:
> I can see one difference though (I didn't see this code before) and that
> is, the connectDBComplete starts with waiting for socket to become
> writable and only then calls PQconnectPoll, while my patch starts with
> PQconnectPoll call. And I see following comment in connectDBstart
>>     /*
>>      * The code for processing CONNECTION_NEEDED state is in PQconnectPoll(),
>>      * so that it can easily be re-executed if needed again during the
>>      * asynchronous startup process.  However, we must run it once here,
>>      * because callers expect a success return from this routine to mean that
>>      * we are in PGRES_POLLING_WRITING connection state.
>>      */

Yes, the libpq documentation also says that.

> If that's the case, the attached should fix it, but I have no way of
> testing it on windows, I can only say that it still works on my machine
> so at least it hopefully does not make things worse.

Committed that.  Let's see how it goes.

I rewrote the while loop as a for loop so that the control logic isn't
spread out over three screens.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: [HACKERS] PATCH: psql show index with type info
Next
From: "Rader, David"
Date:
Subject: Re: [HACKERS] [BUGS] Seems bug in postgres_fdw?