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 5d23016
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions velox/exec/LocalPartition.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ class LocalExchangeSource {
/// copied into the consumers memory pool.
BlockingReason isFinished(ContinueFuture* future);

void close() {
queue_.withWLock([] (auto& queue)) {
queue.clear();
}
}

private:
LocalExchangeMemoryManager* memoryManager_;
const int partition_;
Expand Down Expand Up @@ -120,6 +126,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 5d23016

Please sign in to comment.