Skip to content

Commit

Permalink
Remove transitionToRunning on Stage schedulingComplete()
Browse files Browse the repository at this point in the history
The origin is `dead` code, since the check condition for each
task used SqlStageExecution#getState().
Stage could never lead to RUNNING by this condition.

We remove it, because it is safe and can reduce the task iteration
checks and code is clear(there is only one point to RUNNING)

Cherry-pick of trinodb/trino#9004

Co-authored-by: guhanjie <guhanjiehao@163.com>
  • Loading branch information
2 people authored and tdcmeehan committed Apr 28, 2022
1 parent 8572f28 commit 86e2633
Showing 1 changed file with 0 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,6 @@ public synchronized void schedulingComplete()
return;
}

if (getAllTasks().stream().anyMatch(task -> getState() == StageExecutionState.RUNNING)) {
stateMachine.transitionToRunning();
}
if (finishedTasks.size() == allTasks.size()) {
stateMachine.transitionToFinished();
}
Expand Down

0 comments on commit 86e2633

Please sign in to comment.