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: libpq: drop pending pipelined commands in pqDropConnection().
Date: Thu, 12 May 2022 17:08:46 +0000
Message-ID: <E1npCIw-000NDE-0P@gemulon.postgresql.org> (raw)

libpq: drop pending pipelined commands in pqDropConnection().

The original coding did this in pqDropServerData(), which seems
fairly backwards.  Pending commands are more like already-queued
output data, which is dropped in pqDropConnection().  Moving the
operation means that we clear the command queue immediately upon
detecting connection drop, which improves the sanity of subsequent
behavior.  In particular this eliminates duplicated error message
text as a consequence of code added in b15f25446, which supposed
that a nonempty command queue must mean the prior operation is
still active.

There might be an argument for backpatching this to v14; but as with
b15f25446, I'm unsure about interactions with 618c16707.  For now,
given the lack of complaints about v14's behavior, leave it alone.

Per report from Peter Eisentraut.

Discussion: https://postgr.es/m/de57761c-b99b-3435-b0a6-474c72b1149a@enterprisedb.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/93909599cdba64c8759d646983c0a4ef93de1e50

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



Message-ID: <E1npCIw-000NDE-0P@gemulon.postgresql.org>
Permalink:  ../E1npCIw-000NDE-0P@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1npCIw-000NDE-0P@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: libpq: drop pending pipelined commands in pqDropConnection().
  In-Reply-To: <E1npCIw-000NDE-0P@gemulon.postgresql.org>
  References: <E1npCIw-000NDE-0P@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