Content-Length: 267240 | pFad | http://github.com/postgrespro/postgres_cluster/commit/898a792eb8283e31efc0b6fcbc03bbcd5f7df667

A4 Fix connection leak in DROP SUBSCRIPTION command. · postgrespro/postgres_cluster@898a792 · GitHub
Skip to content

Commit 898a792

Browse files
committed
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.
1 parent 1d04a59 commit 898a792

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/backend/commands/subscriptioncmds.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,10 +546,14 @@ DropSubscription(DropSubscriptionStmt *stmt)
546546
errdetail("The error was: %s", err)));
547547

548548
if (!walrcv_command(wrconn, cmd.data, &err))
549+
{
550+
/* Close the connection in case of failure */
551+
walrcv_disconnect(wrconn);
549552
ereport(ERROR,
550553
(errmsg("could not drop the replication slot \"%s\" on publisher",
551554
slotname),
552555
errdetail("The error was: %s", err)));
556+
}
553557
else
554558
ereport(NOTICE,
555559
(errmsg("dropped replication slot \"%s\" on publisher",

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres_cluster/commit/898a792eb8283e31efc0b6fcbc03bbcd5f7df667

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy