Skip to content

Commit

Permalink
Remove the task from the task list at the end of task destruction (fa…
Browse files Browse the repository at this point in the history
…cebookincubator#11117)

Summary:
Pull Request resolved: facebookincubator#11117

Previously the running task counter is decremented as part of member destruction.
Recent changes to track the running task in a global list for stats tracking but
we remove it from the list at the entry of the task destructor so there is race
condition between the task destruction thread running at the background and the
test shutdown thread. The fix is to move the task list remove at the end of task
destructor. Also note that we manually destroy class members in task destructor
so it is fine to remove the task list in destructor.

Reviewed By: spershin

Differential Revision: D63546925

fbshipit-source-id: 1fe0c8f087a06138035b4d4ef16848faf87d652d
  • Loading branch information
xiaoxmeng authored and facebook-github-bot committed Sep 27, 2024
1 parent 97bf4db commit d5fb0d8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions velox/exec/Task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,9 @@ Task::Task(
}

Task::~Task() {
removeFromTaskList();

SCOPE_EXIT {
removeFromTaskList();
};
// TODO(spershin): Temporary code designed to reveal what causes SIGABRT in
// jemalloc when destroying some Tasks.
std::string clearStage;
Expand Down

0 comments on commit d5fb0d8

Please sign in to comment.