wangbo commented on code in PR #22028:
URL: https://github.com/apache/doris/pull/22028#discussion_r1269117183
##########
be/src/pipeline/task_scheduler.cpp:
##########
@@ -328,27 +328,26 @@ void TaskScheduler::_do_work(size_t index) {
void TaskScheduler::_try_close_task(PipelineTask* task, PipelineTaskState
state) {
// state only should be CANCELED or FINISHED
- task->try_close();
- if (task->is_pending_finish()) {
+ auto status = task->try_close();
+ if (!status.ok() && state != PipelineTaskState::CANCELED) {
+
task->fragment_context()->cancel(PPlanFragmentCancelReason::INTERNAL_ERROR,
+ status.to_string());
+ state = PipelineTaskState::CANCELED;
+ } else if (task->is_pending_finish()) {
task->set_state(PipelineTaskState::PENDING_FINISH);
_blocked_task_scheduler->add_blocked_task(task);
} else {
- auto status = task->close();
+ status = task->close();
if (!status.ok() && state != PipelineTaskState::CANCELED) {
task->fragment_context()->cancel(PPlanFragmentCancelReason::INTERNAL_ERROR,
status.to_string());
state = PipelineTaskState::CANCELED;
- } else {
- if (task->is_pending_finish()) {
- task->set_state(PipelineTaskState::PENDING_FINISH);
- _blocked_task_scheduler->add_blocked_task(task);
- return;
- }
}
- task->set_state(state);
- task->set_close_pipeline_time();
- task->fragment_context()->close_a_pipeline();
+ DCHECK(!task->is_pending_finish()) << task->debug_string();
}
+ task->set_state(state);
+ task->set_close_pipeline_time();
+ task->fragment_context()->close_a_pipeline();
Review Comment:
Why close a pipeline here? even task->is_pending_finish()?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]