pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Use correct connection for cancellation in frontend's parallel s
Date: Sat, 27 Aug 2022 06:23:36 +0000
Message-ID: <E1oRpEG-0006EO-BC@gemulon.postgresql.org> (raw)

Use correct connection for cancellation in frontend's parallel slots

While waiting for slots to become available in wait_on_slots() in
parallel_slot.c, the cancellation always relied on the first connection
in the set to do the job.  This could cause problems when this slot's
socket is gone as PQgetCancel() would return NULL in this case.  Rather
than always using the first connection, this changes the logic to use
the first valid connection for the cancellation.

Author: Ranier Vilela
Reviewed-by: Justin Pryzby
Discussion: https://postgr.es/m/CAEudQAokk1h_pUwGXsYS4oVOuf35s1O2o3TXGHpV8=AWikvgHA@mail.gmail.com
Backpatch-through: 14

Branch
------
REL_14_STABLE

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

Modified Files
--------------
src/fe_utils/parallel_slot.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



view thread (3+ messages)

Message-ID: <E1oRpEG-0006EO-BC@gemulon.postgresql.org>
Permalink:  ../E1oRpEG-0006EO-BC@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1oRpEG-0006EO-BC@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: michael@paquier.xyz
  Subject: Re: pgsql: Use correct connection for cancellation in frontend's parallel s
  In-Reply-To: <E1oRpEG-0006EO-BC@gemulon.postgresql.org>
  References: <E1oRpEG-0006EO-BC@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