Skip to content

Commit

Permalink
[bugfix](core) runtime state is destroyed when spill task is run
Browse files Browse the repository at this point in the history
  • Loading branch information
Doris-Extras committed Aug 19, 2024
1 parent 3a47732 commit f3de50b
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions be/src/pipeline/exec/spill_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,18 @@ class SpillRunnable : public Runnable {
~SpillRunnable() override = default;

void run() override {
// Should lock task context before scope task, because the _state maybe
// destroyed when run is called.
auto task_context_holder = _task_context_holder.lock();
if (!task_context_holder) {
return;
}
SCOPED_ATTACH_TASK(_state);
Defer defer([&] {
std::function<void()> tmp;
std::swap(tmp, _func);
});

auto task_context_holder = _task_context_holder.lock();
if (!task_context_holder) {
return;
}

auto shared_state_holder = _shared_state_holder.lock();
if (!shared_state_holder) {
return;
Expand Down

0 comments on commit f3de50b

Please sign in to comment.