Re: [COMMITTERS] pgsql: Use asynchronous connect API in libpqwalreceiver
Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: Petr Jelinek <petr.jelinek@2ndquadrant.com>, Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@postgreSQL.org, Andrew Dunstan <andrew@dunslane.net>
Date: 2017-03-06T14:38:49Z
Lists: 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
Commits
-
Fix WaitEventSetWait() to handle write-ready waits properly on Windows.
- f7819baa618c 10.0 landed
- 8e6333e1cb77 9.6.3 landed
-
Rewrite async-connection loop in libpqwalreceiver.c, once again.
- b5dd50f2c0ad 10.0 landed
-
Use asynchronous connect API in libpqwalreceiver
- 1e8a85009447 10.0 cited