pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Fujii Masao <fujii@postgresql.org>
Cc: pgsql-committers@postgresql.org
Subject: Re: pgsql: Fix connection leak in DROP SUBSCRIPTION command.
Date: Tue, 21 Feb 2017 14:12:25 -0500
Message-ID: <2058.1487704345@sss.pgh.pa.us> (raw)
In-Reply-To: <E1cgFIh-0007XH-Js@gemulon.postgresql.org>
References: <E1cgFIh-0007XH-Js@gemulon.postgresql.org>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

Fujii Masao <fujii@postgresql.org> writes:
> Fix connection leak in DROP SUBSCRIPTION command.
> Previously the command forgot to close the connection to the publisher
> when it failed to drop the replication slot.

If there's a bug here, this seems like an extremely unreliable way of
fixing it.  What if an error gets thrown before you reach that ereport?

In other words, this coding is assuming that the walrcv_command()
subroutine cannot throw an error, which I would consider dangerous
even if it were a fixed subroutine.  If it's a hook that's doing
unknown stuff, that seems a completely untenable assumption.  You
really need either to hook the cleanup action into normal error
recovery, or to use a PG_TRY block.

			regards, tom lane


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers



view thread (8+ messages)  latest in thread

Message-ID: <2058.1487704345@sss.pgh.pa.us>
Permalink:  ../2058.1487704345@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2058.1487704345@sss.pgh.pa.us

 · 

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, fujii@postgresql.org
  Subject: Re: pgsql: Fix connection leak in DROP SUBSCRIPTION command.
  In-Reply-To: <2058.1487704345@sss.pgh.pa.us>
  References: <E1cgFIh-0007XH-Js@gemulon.postgresql.org> <2058.1487704345@sss.pgh.pa.us>

* 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