Skip to content

Commit

Permalink
[pipeline](close) change the close order in pipeline engine
Browse files Browse the repository at this point in the history
  • Loading branch information
HappenLee committed Nov 20, 2023
1 parent 3f3f81f commit 95d1110
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions be/src/pipeline/task_scheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -363,9 +363,8 @@ void TaskScheduler::_try_close_task(PipelineTask* task, PipelineTaskState state,
auto try_close_failed = !status.ok() && state != PipelineTaskState::CANCELED;
if (try_close_failed) {
cancel();
// Call `close` if `try_close` failed to make sure allocated resources are released
static_cast<void>(task->close(exec_status));
} else if (!task->is_pipelineX() && task->is_pending_finish()) {
}
if (!task->is_pipelineX() && task->is_pending_finish()) {
task->set_state(PipelineTaskState::PENDING_FINISH);
static_cast<void>(_blocked_task_scheduler->add_blocked_task(task));
task->set_running(false);
Expand All @@ -375,6 +374,7 @@ void TaskScheduler::_try_close_task(PipelineTask* task, PipelineTaskState state,
task->set_running(false);
return;
}

status = task->close(exec_status);
if (!status.ok() && state != PipelineTaskState::CANCELED) {
cancel();
Expand Down

0 comments on commit 95d1110

Please sign in to comment.