github-actions[bot] commented on code in PR #45207:
URL: https://github.com/apache/doris/pull/45207#discussion_r1886365565


##########
be/src/pipeline/pipeline_task.cpp:
##########
@@ -279,25 +271,22 @@ bool PipelineTask::_is_blocked() {
         _blocked_dep = op_dep->is_blocked_by(this);
         if (_blocked_dep != nullptr) {
             _blocked_dep->start_watcher();
-            if (_wake_up_by_downstream) {
-                _eos = true;
-            }
             return true;
         }
     }
     return false;
 }
 
 Status PipelineTask::execute(bool* eos) {

Review Comment:
   warning: function 'execute' has cognitive complexity of 70 (threshold 50) 
[readability-function-cognitive-complexity]
   ```cpp
   Status PipelineTask::execute(bool* eos) {
                        ^
   ```
   <details>
   <summary>Additional context</summary>
   
   **be/src/pipeline/pipeline_task.cpp:280:** +1, including nesting penalty of 
0, nesting level increased to 1
   ```cpp
       if (_eos) {
       ^
   ```
   **be/src/pipeline/pipeline_task.cpp:290:** +1, including nesting penalty of 
0, nesting level increased to 1
   ```cpp
       DBUG_EXECUTE_IF("fault_inject::PipelineXTask::execute", {
       ^
   ```
   **be/src/util/debug_points.h:36:** expanded from macro 'DBUG_EXECUTE_IF'
   ```cpp
       if (UNLIKELY(config::enable_debug_points)) {                             
 \
       ^
   ```
   **be/src/pipeline/pipeline_task.cpp:290:** +2, including nesting penalty of 
1, nesting level increased to 2
   ```cpp
       DBUG_EXECUTE_IF("fault_inject::PipelineXTask::execute", {
       ^
   ```
   **be/src/util/debug_points.h:38:** expanded from macro 'DBUG_EXECUTE_IF'
   ```cpp
           if (dp) {                                                            
 \
           ^
   ```
   **be/src/pipeline/pipeline_task.cpp:308:** +1, including nesting penalty of 
0, nesting level increased to 1
   ```cpp
       if (_wait_to_start()) {
       ^
   ```
   **be/src/pipeline/pipeline_task.cpp:313:** +1, including nesting penalty of 
0, nesting level increased to 1
   ```cpp
       if (!_opened && !_fragment_context->is_canceled()) {
       ^
   ```
   **be/src/pipeline/pipeline_task.cpp:313:** +1
   ```cpp
       if (!_opened && !_fragment_context->is_canceled()) {
                    ^
   ```
   **be/src/pipeline/pipeline_task.cpp:314:** +2, including nesting penalty of 
1, nesting level increased to 2
   ```cpp
           if (_wake_up_early) {
           ^
   ```
   **be/src/pipeline/pipeline_task.cpp:319:** +2, including nesting penalty of 
1, nesting level increased to 2
   ```cpp
           RETURN_IF_ERROR(_open());
           ^
   ```
   **be/src/common/status.h:632:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/pipeline/pipeline_task.cpp:319:** +3, including nesting penalty of 
2, nesting level increased to 3
   ```cpp
           RETURN_IF_ERROR(_open());
           ^
   ```
   **be/src/common/status.h:634:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   **be/src/pipeline/pipeline_task.cpp:322:** nesting level increased to 1
   ```cpp
       auto set_wake_up_and_dep_ready = [&]() {
                                        ^
   ```
   **be/src/pipeline/pipeline_task.cpp:323:** +2, including nesting penalty of 
1, nesting level increased to 2
   ```cpp
           if (wake_up_early()) {
           ^
   ```
   **be/src/pipeline/pipeline_task.cpp:332:** +1, including nesting penalty of 
0, nesting level increased to 1
   ```cpp
       while (!_fragment_context->is_canceled()) {
       ^
   ```
   **be/src/pipeline/pipeline_task.cpp:333:** +2, including nesting penalty of 
1, nesting level increased to 2
   ```cpp
           if (_is_blocked()) {
           ^
   ```
   **be/src/pipeline/pipeline_task.cpp:340:** +2, including nesting penalty of 
1, nesting level increased to 2
   ```cpp
           if (_fragment_context->is_canceled()) {
           ^
   ```
   **be/src/pipeline/pipeline_task.cpp:344:** +2, including nesting penalty of 
1, nesting level increased to 2
   ```cpp
           if (time_spent > THREAD_TIME_SLICE) {
           ^
   ```
   **be/src/pipeline/pipeline_task.cpp:352:** +2, including nesting penalty of 
1, nesting level increased to 2
   ```cpp
           if (should_revoke_memory(_state, sink_revocable_mem_size)) {
           ^
   ```
   **be/src/pipeline/pipeline_task.cpp:353:** +3, including nesting penalty of 
2, nesting level increased to 3
   ```cpp
               RETURN_IF_ERROR(_sink->revoke_memory(_state));
               ^
   ```
   **be/src/common/status.h:632:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/pipeline/pipeline_task.cpp:353:** +4, including nesting penalty of 
3, nesting level increased to 4
   ```cpp
               RETURN_IF_ERROR(_sink->revoke_memory(_state));
               ^
   ```
   **be/src/common/status.h:634:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   **be/src/pipeline/pipeline_task.cpp:356:** +2, including nesting penalty of 
1, nesting level increased to 2
   ```cpp
           DBUG_EXECUTE_IF("fault_inject::PipelineXTask::executing", {
           ^
   ```
   **be/src/util/debug_points.h:36:** expanded from macro 'DBUG_EXECUTE_IF'
   ```cpp
       if (UNLIKELY(config::enable_debug_points)) {                             
 \
       ^
   ```
   **be/src/pipeline/pipeline_task.cpp:356:** +3, including nesting penalty of 
2, nesting level increased to 3
   ```cpp
           DBUG_EXECUTE_IF("fault_inject::PipelineXTask::executing", {
           ^
   ```
   **be/src/util/debug_points.h:38:** expanded from macro 'DBUG_EXECUTE_IF'
   ```cpp
           if (dp) {                                                            
 \
           ^
   ```
   **be/src/pipeline/pipeline_task.cpp:362:** +2, including nesting penalty of 
1, nesting level increased to 2
   ```cpp
           if (_sink->is_finished(_state)) {
           ^
   ```
   **be/src/pipeline/pipeline_task.cpp:367:** +1
   ```cpp
           *eos = wake_up_early() || _dry_run;
                                  ^
   ```
   **be/src/pipeline/pipeline_task.cpp:368:** +2, including nesting penalty of 
1, nesting level increased to 2
   ```cpp
           if (!*eos) {
           ^
   ```
   **be/src/pipeline/pipeline_task.cpp:371:** +3, including nesting penalty of 
2, nesting level increased to 3
   ```cpp
               RETURN_IF_ERROR(_root->get_block_after_projects(_state, block, 
eos));
               ^
   ```
   **be/src/common/status.h:632:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/pipeline/pipeline_task.cpp:371:** +4, including nesting penalty of 
3, nesting level increased to 4
   ```cpp
               RETURN_IF_ERROR(_root->get_block_after_projects(_state, block, 
eos));
               ^
   ```
   **be/src/common/status.h:634:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   **be/src/pipeline/pipeline_task.cpp:374:** +2, including nesting penalty of 
1, nesting level increased to 2
   ```cpp
           if (*eos) {
           ^
   ```
   **be/src/pipeline/pipeline_task.cpp:375:** +3, including nesting penalty of 
2, nesting level increased to 3
   ```cpp
               RETURN_IF_ERROR(close(Status::OK(), false));
               ^
   ```
   **be/src/common/status.h:632:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/pipeline/pipeline_task.cpp:375:** +4, including nesting penalty of 
3, nesting level increased to 4
   ```cpp
               RETURN_IF_ERROR(close(Status::OK(), false));
               ^
   ```
   **be/src/common/status.h:634:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   **be/src/pipeline/pipeline_task.cpp:378:** +2, including nesting penalty of 
1, nesting level increased to 2
   ```cpp
           if (_block->rows() != 0 || *eos) {
           ^
   ```
   **be/src/pipeline/pipeline_task.cpp:382:** +3, including nesting penalty of 
2, nesting level increased to 3
   ```cpp
               if (status.is<ErrorCode::END_OF_FILE>()) {
               ^
   ```
   **be/src/pipeline/pipeline_task.cpp:384:** +1, nesting level increased to 3
   ```cpp
               } else if (!status) {
                      ^
   ```
   **be/src/pipeline/pipeline_task.cpp:388:** +3, including nesting penalty of 
2, nesting level increased to 3
   ```cpp
               if (*eos) { // just return, the scheduler will do finish work
               ^
   ```
   **be/src/pipeline/pipeline_task.cpp:396:** +1, including nesting penalty of 
0, nesting level increased to 1
   ```cpp
       RETURN_IF_ERROR(get_task_queue()->push_back(this));
       ^
   ```
   **be/src/common/status.h:632:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/pipeline/pipeline_task.cpp:396:** +2, including nesting penalty of 
1, nesting level increased to 2
   ```cpp
       RETURN_IF_ERROR(get_task_queue()->push_back(this));
       ^
   ```
   **be/src/common/status.h:634:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   
   </details>
   



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to