Skip to content

Commit ac680fb

Browse files
authored
Merge dff9ab4 into 508e93d
2 parents 508e93d + dff9ab4 commit ac680fb

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

ydb/core/kqp/compute_actor/kqp_scan_compute_actor.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ class TKqpScanComputeActor: public TSchedulableComputeActorBase<TKqpScanComputeA
8787
TBase::OnMemoryLimitExceptionHandler();
8888
} catch (const yexception& e) {
8989
InternalError(NYql::NDqProto::StatusIds::INTERNAL_ERROR, NYql::TIssuesIds::DEFAULT_ERROR, e.what());
90+
FreeComputeCtxData();
9091
}
9192

9293
TBase::ReportEventElapsedTime();
@@ -127,17 +128,21 @@ class TKqpScanComputeActor: public TSchedulableComputeActorBase<TKqpScanComputeA
127128

128129
void PollSources(ui64 prevFreeSpace);
129130

130-
void PassAway() override {
131+
void DoTerminateImpl() override {
132+
FreeComputeCtxData();
133+
TBase::DoTerminateImpl();
134+
}
135+
136+
void FreeComputeCtxData() {
131137
if (TaskRunner) {
132138
if (TaskRunner->IsAllocatorAttached()) {
133139
ComputeCtx.Clear();
134140
} else {
135141
auto guard = TaskRunner->BindAllocator(TBase::GetMkqlMemoryLimit());
136142
ComputeCtx.Clear();
137143
}
144+
ScanData = nullptr;
138145
}
139-
140-
TBase::PassAway();
141146
}
142147

143148
void TerminateSources(const NYql::TIssues& issues, bool success) override {

0 commit comments

Comments
 (0)