pgsql: Fix connection leak in DROP SUBSCRIPTION command, take 2.

From: Fujii Masao <fujii(at)postgresql(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix connection leak in DROP SUBSCRIPTION command, take 2.
Date: 2017-03-08 14:45:03
Message-ID: E1clcpr-0007ib-44@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix connection leak in DROP SUBSCRIPTION command, take 2.

Commit 898a792eb8283e31efc0b6fcbc03bbcd5f7df667 fixed the connection
leak issue, but it was an unreliable way of bugfix. This bugfix was
assuming that walrcv_command() subroutine cannot throw an error,
but it's untenable assumption. For example, if it will be changed
so that an error is thrown, connection leak issue will happen again.

This patch ensures that the connection is closed even when
walrcv_command() subroutine throws an error.

Patch by me, reviewed by Petr Jelinek and Michael Paquier

Discussion: https://www.postgresql.org/message-id/2058.1487704345@sss.pgh.pa.us

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/77d21970ae19418f321e6a76ddf1a57ae999c77a

Modified Files
--------------
src/backend/commands/subscriptioncmds.c | 24 +++++++++++++++---------
1 file changed, 15 insertions(+), 9 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Fujii Masao 2017-03-08 14:46:29 Re: pgsql: Fix connection leak in DROP SUBSCRIPTION command.
Previous Message Tom Lane 2017-03-08 14:38:19 Re: pgsql: Create INSTALL file via XSLT