Skip to content

Commit

Permalink
[pipelineX](bug) Fix potential memory access problem (#27326)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel39 authored Nov 21, 2023
1 parent 016dccb commit 7212822
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion be/src/pipeline/task_scheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,12 @@ Status BlockedTaskScheduler::add_blocked_task(PipelineTask* task) {
if (!static_cast<PipelineXTask*>(task)->push_blocked_task_to_queue()) {
// put this task into current dependency's blocking queue and wait for event notification
// instead of using a separate BlockedTaskScheduler.
task->set_running(false);
return Status::OK();
}
_blocked_tasks.push_back(task);
_task_cond.notify_one();
task->set_running(false);
return Status::OK();
}

Expand Down Expand Up @@ -337,7 +339,6 @@ void TaskScheduler::_do_work(size_t index) {
}

auto pipeline_state = task->get_state();
task->set_running(false);
switch (pipeline_state) {
case PipelineTaskState::BLOCKED_FOR_SOURCE:
case PipelineTaskState::BLOCKED_FOR_SINK:
Expand All @@ -346,6 +347,7 @@ void TaskScheduler::_do_work(size_t index) {
static_cast<void>(_blocked_task_scheduler->add_blocked_task(task));
break;
case PipelineTaskState::RUNNABLE:
task->set_running(false);
static_cast<void>(_task_queue->push_back(task, index));
break;
default:
Expand Down

0 comments on commit 7212822

Please sign in to comment.