Skip to content

Commit

Permalink
Free resources in LocalExchangeSourceOperator::close
Browse files Browse the repository at this point in the history
  • Loading branch information
mbasmanova committed Sep 23, 2021
1 parent 85bdb1f commit 6d17dbc
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions velox/exec/LocalPartition.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,14 @@ class LocalExchangeSource {
/// copied into the consumers memory pool.
BlockingReason isFinished(ContinueFuture* future);

void close() {
queue_.withWLock([](auto& queue) {
while (!queue.empty()) {
queue.pop();
}
});
}

private:
LocalExchangeMemoryManager* memoryManager_;
const int partition_;
Expand Down Expand Up @@ -120,6 +128,11 @@ class LocalExchangeSourceOperator : public SourceOperator {

RowVectorPtr getOutput() override;

void close() override {
Operator::close();
source_->close();
}

private:
const int partition_;
const std::shared_ptr<LocalExchangeSource> source_{nullptr};
Expand Down

0 comments on commit 6d17dbc

Please sign in to comment.