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: Don't let libpq PGEVT_CONNRESET callbacks break a PGconn.
Date: Fri, 18 Feb 2022 16:43:20 +0000
Message-ID: <E1nL6Lo-0006pO-Oy@gemulon.postgresql.org> (raw)

Don't let libpq PGEVT_CONNRESET callbacks break a PGconn.

As currently implemented, failure of a PGEVT_CONNRESET callback
forces the PGconn into the CONNECTION_BAD state (without closing
the socket, which is inconsistent with other failure paths), and
prevents later callbacks from being called.  This seems highly
questionable, and indeed is questioned by comments in the source.

Instead, let's just ignore the result value of PGEVT_CONNRESET
calls.  Like the preceding commit, this converts event callbacks
into "pure observers" that cannot affect libpq's processing logic.

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/2e372869aa38a9d6e4552c192da4454b17e01e38

Modified Files
--------------
doc/src/sgml/libpq.sgml           | 11 +++++------
src/interfaces/libpq/fe-connect.c | 28 ++++++----------------------
2 files changed, 11 insertions(+), 28 deletions(-)



Message-ID: <E1nL6Lo-0006pO-Oy@gemulon.postgresql.org>
Permalink:  ../E1nL6Lo-0006pO-Oy@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1nL6Lo-0006pO-Oy@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: Don't let libpq PGEVT_CONNRESET callbacks break a PGconn.
  In-Reply-To: <E1nL6Lo-0006pO-Oy@gemulon.postgresql.org>
  References: <E1nL6Lo-0006pO-Oy@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