Skip site navigation (1) Skip section navigation (2)

Re: pgsql: Fix connection leak in DROP SUBSCRIPTION command.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Fujii Masao <fujii(at)postgresql(dot)org>
Cc: pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: Fix connection leak in DROP SUBSCRIPTION command.
Date: 2017-02-21 19:12:25
Message-ID: 2058.1487704345@sss.pgh.pa.us (view raw, whole thread or download thread mbox)
Thread:
Lists: pgsql-committers
Fujii Masao <fujii(at)postgresql(dot)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


In response to

Responses

pgsql-committers by date

Next:From: Peter EisentrautDate: 2017-02-21 20:44:17
Subject: pgsql: Fix whitespace
Previous:From: Tom LaneDate: 2017-02-21 19:04:01
Subject: Re: pgsql: Make walsender always initialize the buffers.

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group