HappenLee commented on code in PR #61989:
URL: https://github.com/apache/doris/pull/61989#discussion_r3031350672
##########
be/src/exec/pipeline/pipeline_task.cpp:
##########
@@ -1063,11 +1063,19 @@ Status PipelineTask::_state_transition(State new_state)
{
}
_task_profile->add_info_string("TaskState", _to_string(new_state));
_task_profile->add_info_string("BlockedByDependency", _blocked_dep ?
_blocked_dep->name() : "");
- if (!LEGAL_STATE_TRANSITION[(int)new_state].contains(_exec_state)) {
+ const auto& table =
+ _wake_up_early ? WAKE_UP_EARLY_LEGAL_STATE_TRANSITION :
LEGAL_STATE_TRANSITION;
+ if (!table[(int)new_state].contains(_exec_state)) {
return Status::InternalError(
"Task state transition from {} to {} is not allowed! Task
info: {}",
_to_string(_exec_state), _to_string(new_state),
debug_string());
}
+ // FINISHED/FINALIZED → RUNNABLE is legal under wake_up_early (delayed
wake_up() arriving
+ // after the task already terminated), but we must not actually move the
state backwards.
+ if ((_exec_state == State::FINISHED || _exec_state == State::FINALIZED) &&
+ new_state == State::RUNNABLE) {
+ return Status::OK();
+ }
Review Comment:
这里应该加个else,等于统一用最后的return来返回啊,代码格式得讲究一下
--
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]