Skip to content

Commit

Permalink
Wait for all the tasks to be deleted before reset memory system
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoxmeng committed Apr 11, 2024
1 parent a3b4849 commit ba2c06a
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 19 deletions.
5 changes: 0 additions & 5 deletions velox/exec/tests/HashJoinTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -792,11 +792,6 @@ class HashJoinTest : public HiveConnectorTestBase {
.allowLazyVector = false};
}

void TearDown() override {
waitForAllTasksToBeDeleted();
HiveConnectorTestBase::TearDown();
}

// Make splits with each plan node having a number of source files.
SplitInput makeSpiltInput(
const std::vector<core::PlanNodeId>& nodeIds,
Expand Down
2 changes: 0 additions & 2 deletions velox/exec/tests/MultiFragmentTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ class MultiFragmentTest : public HiveConnectorTestBase {
}

void TearDown() override {
waitForAllTasksToBeDeleted();

// There might be lingering exchange source on executor even after all tasks
// are deleted. This can cause memory leak because exchange source holds
// reference to memory pool. We need to make sure they are properly cleaned.
Expand Down
1 change: 0 additions & 1 deletion velox/exec/tests/OperatorUtilsTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class OperatorUtilsTest : public OperatorTestBase {
driverCtx_.reset();
driver_.reset();
task_.reset();
waitForAllTasksToBeDeleted();
OperatorTestBase::TearDown();
}

Expand Down
5 changes: 0 additions & 5 deletions velox/exec/tests/TableWriteTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,6 @@ class TableWriteTest : public HiveConnectorTestBase {
HiveConnectorTestBase::SetUp();
}

void TearDown() override {
waitForAllTasksToBeDeleted();
HiveConnectorTestBase::TearDown();
}

std::shared_ptr<Task> assertQueryWithWriterConfigs(
const core::PlanNodePtr& plan,
std::vector<std::shared_ptr<TempFilePath>> filePaths,
Expand Down
5 changes: 0 additions & 5 deletions velox/exec/tests/TaskTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -460,11 +460,6 @@ class TestBadMemoryTranslator : public exec::Operator::PlanNodeTranslator {

class TaskTest : public HiveConnectorTestBase {
protected:
void TearDown() override {
waitForAllTasksToBeDeleted();
HiveConnectorTestBase::TearDown();
}

static std::pair<std::shared_ptr<exec::Task>, std::vector<RowVectorPtr>>
executeSingleThreaded(
core::PlanFragment plan,
Expand Down
1 change: 0 additions & 1 deletion velox/exec/tests/ValuesTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ namespace facebook::velox::exec::test {
class ValuesTest : public OperatorTestBase {
protected:
void TearDown() override {
waitForAllTasksToBeDeleted();
input_.reset();
input2_.reset();
OperatorTestBase::TearDown();
Expand Down
1 change: 1 addition & 0 deletions velox/exec/tests/utils/OperatorTestBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ void OperatorTestBase::SetUp() {
}

void OperatorTestBase::TearDown() {
waitForAllTasksToBeDeleted();
pool_.reset();
rootPool_.reset();
resetMemory();
Expand Down

0 comments on commit ba2c06a

Please sign in to comment.