aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpnv1 <pnv1@yandex-team.ru>2022-02-12 15:05:05 +0300
committerpnv1 <pnv1@yandex-team.ru>2022-02-12 15:05:05 +0300
commitee42a6e9701086b2a04cf4f4c4d29a07d99b884f (patch)
tree362937070983f0cdbdf00ef7e0308b388b945cdd
parent2eb2a1c80fbc1918baa21b7eee149a6590a4a7fe (diff)
downloadydb-ee42a6e9701086b2a04cf4f4c4d29a07d99b884f.tar.gz
Fix leaks in AlterGroup, KIKIMR-14305
ref:6cfcf1fed1ec0a87e4e845e664a7dce07d130d25
-rw-r--r--ydb/core/kqp/kqp_ic_gateway.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/ydb/core/kqp/kqp_ic_gateway.cpp b/ydb/core/kqp/kqp_ic_gateway.cpp
index a82fd4c5a2..196da496c9 100644
--- a/ydb/core/kqp/kqp_ic_gateway.cpp
+++ b/ydb/core/kqp/kqp_ic_gateway.cpp
@@ -1523,12 +1523,13 @@ public:
);
SendSchemeRequest(ev.Release()).Apply(
- [alterGroupPromise, sendRoleWrapper, groupName = std::move(groupName), action, restOfRoles = std::move(restOfRoles)]
+ [alterGroupPromise, &sendRoleWrapper, groupName = std::move(groupName), action, restOfRoles = std::move(restOfRoles)]
(const TFuture<TGenericResult>& future) mutable
{
auto result = future.GetValue();
if (!result.Success()) {
alterGroupPromise.SetValue(result);
+ sendRoleWrapper.Reset();
return;
}
if (restOfRoles.size()) {
@@ -1536,9 +1537,11 @@ public:
sendRoleWrapper->SendNextRole(std::move(groupName), action, std::move(restOfRoles));
}
catch (yexception& e) {
+ sendRoleWrapper.Reset();
return alterGroupPromise.SetValue(ResultFromException<TGenericResult>(e));
}
} else {
+ sendRoleWrapper.Reset();
alterGroupPromise.SetValue(result);
}
}