Skip to content

Commit

Permalink
Wait for all the tasks to be deleted before reset memory system (face…
Browse files Browse the repository at this point in the history
…bookincubator#9458)

Summary: Pull Request resolved: facebookincubator#9458

Reviewed By: tanjialiang

Differential Revision: D56041868

Pulled By: xiaoxmeng

fbshipit-source-id: 92cad676014a612abdfe60501465cc3e196252d1
  • Loading branch information
xiaoxmeng authored and facebook-github-bot committed Apr 12, 2024
1 parent 70d8de1 commit 4b0fd74
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 20 deletions.
1 change: 0 additions & 1 deletion velox/common/memory/tests/MemoryCapExceededTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ class MemoryCapExceededTest : public OperatorTestBase,
}

void TearDown() override {
waitForAllTasksToBeDeleted();
OperatorTestBase::TearDown();
FLAGS_velox_suppress_memory_capacity_exceeding_error_message = false;
}
Expand Down
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 4b0fd74

Please sign in to comment.