aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexey Ozeritskiy <aozeritsky@gmail.com>2022-06-06 15:39:10 +0300
committerAlexey Ozeritskiy <aozeritsky@gmail.com>2022-06-06 15:39:10 +0300
commit780b50fea3c9c5351006caf0cfc9b69744702f0b (patch)
treeeaf792e825435f89cacf5c6498857548b8638131
parente5e0e3e814cf0b04b0205a612df8a2bcb4086caa (diff)
downloadydb-780b50fea3c9c5351006caf0cfc9b69744702f0b.tar.gz
YQ-1095: Cleanup channels (and all unboxedvalues) on terminate
ref:f5c5e87f1a4035da4b5d822fe662cc8d1d095351
-rw-r--r--ydb/library/yql/dq/actors/compute/dq_compute_actor_impl.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/ydb/library/yql/dq/actors/compute/dq_compute_actor_impl.h b/ydb/library/yql/dq/actors/compute/dq_compute_actor_impl.h
index 13d4b041f05..e3157ea5174 100644
--- a/ydb/library/yql/dq/actors/compute/dq_compute_actor_impl.h
+++ b/ydb/library/yql/dq/actors/compute/dq_compute_actor_impl.h
@@ -470,6 +470,19 @@ protected:
RuntimeSettings.TerminateHandler(success, issues);
}
+ {
+ // free MKQL memory then destroy TaskRunner and Allocator
+ auto guard = BindAllocator();
+#define CLEANUP(what) decltype(what) what##_; what.swap(what##_);
+ CLEANUP(InputChannelsMap);
+ CLEANUP(SourcesMap);
+ CLEANUP(InputTransformsMap);
+ CLEANUP(OutputChannelsMap);
+ CLEANUP(SinksMap);
+ CLEANUP(OutputTransformsMap);
+#undef CLEANUP
+ }
+
this->PassAway();
MemoryQuota = nullptr;
}