projects
/
postgresql.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1d04a59
)
Fix connection leak in DROP SUBSCRIPTION command.
author
Fujii Masao
<fujii@postgresql.org>
Tue, 21 Feb 2017 18:36:02 +0000
(
03:36
+0900)
committer
Fujii Masao
<fujii@postgresql.org>
Tue, 21 Feb 2017 18:36:02 +0000
(
03:36
+0900)
Previously the command forgot to close the connection to the publisher
when it failed to drop the replication slot.
src/backend/commands/subscriptioncmds.c
patch
|
blob
|
blame
|
history
diff --git
a/src/backend/commands/subscriptioncmds.c
b/src/backend/commands/subscriptioncmds.c
index ab21e64b48875455ff409ed588ddf207f0bdf1fb..c9e7c08c8c1829f641e09f52991b8544a3828428 100644
(file)
--- a/
src/backend/commands/subscriptioncmds.c
+++ b/
src/backend/commands/subscriptioncmds.c
@@
-546,10
+546,14
@@
DropSubscription(DropSubscriptionStmt *stmt)
errdetail("The error was: %s", err)));
if (!walrcv_command(wrconn, cmd.data, &err))
+ {
+ /* Close the connection in case of failure */
+ walrcv_disconnect(wrconn);
ereport(ERROR,
(errmsg("could not drop the replication slot \"%s\" on publisher",
slotname),
errdetail("The error was: %s", err)));
+ }
else
ereport(NOTICE,
(errmsg("dropped replication slot \"%s\" on publisher",