From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: Petr Jelinek <petr.jelinek@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@postgreSQL.org, Andrew Dunstan <andrew@dunslane.net>
Subject: Re: [COMMITTERS] pgsql: Use asynchronous connect API in libpqwalreceiver
Date: Mon, 6 Mar 2017 09:38:49 -0500
Message-ID: <dcef4616-21af-5ec0-4113-d409e5ddbf86@2ndquadrant.com> (raw)
In-Reply-To: <4144256b-dc4f-892c-a720-71f6e7b9ac87@2ndquadrant.com>
References: <E1cjo1g-0000mr-ST@gemulon.postgresql.org>
<19403.1488586564@sss.pgh.pa.us>
<34d98fbf-9195-04d2-b85a-634d6952ffdf@2ndquadrant.com>
<19815.1488600693@sss.pgh.pa.us>
<4144256b-dc4f-892c-a720-71f6e7b9ac87@2ndquadrant.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: peter.eisentraut@2ndquadrant.com, petr.jelinek@2ndquadrant.com, tgl@sss.pgh.pa.us, andrew@dunslane.net
Subject: Re: [COMMITTERS] pgsql: Use asynchronous connect API in libpqwalreceiver
In-Reply-To: <dcef4616-21af-5ec0-4113-d409e5ddbf86@2ndquadrant.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox