pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Try next host after a "cannot connect now" failure.
Date: Mon, 11 Jan 2021 19:12:41 +0000
Message-ID: <E1kz2cL-0006Vi-Tq@gemulon.postgresql.org> (raw)

Try next host after a "cannot connect now" failure.

If a server returns ERRCODE_CANNOT_CONNECT_NOW, try the next host,
if multiple host names have been provided.  This allows dealing
gracefully with standby servers that might not be in hot standby mode
yet.

In the wake of the preceding commit, it might be plausible to retry
many more error cases than we do now, but I (tgl) am hesitant to
move too aggressively on that --- it's not clear it'd be desirable
for cases such as bad-password, for example.  But this case seems
safe enough.

Hubert Zhang, reviewed by Takayuki Tsunakawa

Discussion: https://postgr.es/m/BN6PR05MB3492948E4FD76C156E747E8BC9160@BN6PR05MB3492.namprd05.prod.outlook.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/c1d589571c497a952d7fbe40d9828655859d746f

Modified Files
--------------
src/interfaces/libpq/fe-connect.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)



Message-ID: <E1kz2cL-0006Vi-Tq@gemulon.postgresql.org>
Permalink:  ../E1kz2cL-0006Vi-Tq@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1kz2cL-0006Vi-Tq@gemulon.postgresql.org

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Try next host after a "cannot connect now" failure.
  In-Reply-To: <E1kz2cL-0006Vi-Tq@gemulon.postgresql.org>
  References: <E1kz2cL-0006Vi-Tq@gemulon.postgresql.org>

* 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