presto-main/src/main/java/io/prestosql/execution/SqlStageExecution.java/SqlStageExecution/initialize
class SqlStageExecution:    private void initialize()
    {
        stateMachine.addStateChangeListener(newState -> checkAllTaskFinal());
    }