Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rpc test] #43890

Closed
wants to merge 4 commits into from
Closed

[rpc test] #43890

wants to merge 4 commits into from

Conversation

Mryange
Copy link
Contributor

@Mryange Mryange commented Nov 13, 2024

What problem does this PR solve?

Issue Number: close #xxx

Related PR: #xxx

Problem Summary:

Release note

None

Check List (For Author)

  • Test

    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
    • No need to test or manual test. Explain why:
      • This is a refactor/code format and no logic has been changed.
      • Previous test can cover this change.
      • No code files have been changed.
      • Other reason
  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

@doris-robot
Copy link

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@Mryange
Copy link
Contributor Author

Mryange commented Nov 13, 2024

run buildall

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

@@ -211,8 +214,6 @@ Status ExchangeSinkBuffer::add_block(BroadcastTransmitInfo&& request) {
Status ExchangeSinkBuffer::_send_rpc(InstanceLoId id) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function '_send_rpc' has cognitive complexity of 70 (threshold 50) [readability-function-cognitive-complexity]

Status ExchangeSinkBuffer::_send_rpc(InstanceLoId id) {
                           ^
Additional context

be/src/pipeline/exec/exchange_sink_buffer.cpp:220: +1, including nesting penalty of 0, nesting level increased to 1

    if (_is_finishing) {
    ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:225: +1, including nesting penalty of 0, nesting level increased to 1

    if (!q.empty()) {
    ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:233: +2, including nesting penalty of 1, nesting level increased to 2

        if (request.block && !request.block->column_metas().empty()) {
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:233: +1

        if (request.block && !request.block->column_metas().empty()) {
                          ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:236: +2, including nesting penalty of 1, nesting level increased to 2

        if (!request.exec_status.ok()) {
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:242: +2, including nesting penalty of 1, nesting level increased to 2

        if (config::execution_ignore_eovercrowded) {
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:245: nesting level increased to 2

        send_callback->addFailedHandler([&, weak_task_ctx = weak_task_exec_ctx()](
                                        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:248: +3, including nesting penalty of 2, nesting level increased to 3

            if (task_lock == nullptr) {
            ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:257: nesting level increased to 2

        send_callback->addSuccessHandler([&, weak_task_ctx = weak_task_exec_ctx()](
                                         ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:262: +3, including nesting penalty of 2, nesting level increased to 3

            if (task_lock == nullptr) {
            ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:273: +3, including nesting penalty of 2, nesting level increased to 3

            if (s.is<ErrorCode::END_OF_FILE>()) {
            ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:275: +1, nesting level increased to 3

            } else if (!s.ok()) {
                   ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:279: +1, nesting level increased to 3

            } else if (eos) {
                   ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:284: +3, including nesting penalty of 2, nesting level increased to 3

                if (!s) {
                ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:295: +2, including nesting penalty of 1, nesting level increased to 2

            if (enable_http_send_block(*brpc_request)) {
            ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:296: +3, including nesting penalty of 2, nesting level increased to 3

                RETURN_IF_ERROR(transmit_block_httpv2(_context->exec_env(),
                ^

be/src/common/status.h:630: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:296: +4, including nesting penalty of 3, nesting level increased to 4

                RETURN_IF_ERROR(transmit_block_httpv2(_context->exec_env(),
                ^

be/src/common/status.h:632: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:299: +1, nesting level increased to 2

            } else {
              ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:304: +2, including nesting penalty of 1, nesting level increased to 2

        if (request.block) {
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:311: +2, including nesting penalty of 1, nesting level increased to 2

        if (_total_queue_size <= _queue_capacity) {
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:316: +1, nesting level increased to 1

    } else if (!broadcast_q.empty()) {
           ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:324: +2, including nesting penalty of 1, nesting level increased to 2

        if (request.block_holder->get_block() &&
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:324: +1

        if (request.block_holder->get_block() &&
                                              ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:330: +2, including nesting penalty of 1, nesting level increased to 2

        if (config::execution_ignore_eovercrowded) {
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:333: nesting level increased to 2

        send_callback->addFailedHandler([&, weak_task_ctx = weak_task_exec_ctx()](
                                        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:336: +3, including nesting penalty of 2, nesting level increased to 3

            if (task_lock == nullptr) {
            ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:345: nesting level increased to 2

        send_callback->addSuccessHandler([&, weak_task_ctx = weak_task_exec_ctx()](
                                         ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:350: +3, including nesting penalty of 2, nesting level increased to 3

            if (task_lock == nullptr) {
            ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:361: +3, including nesting penalty of 2, nesting level increased to 3

            if (s.is<ErrorCode::END_OF_FILE>()) {
            ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:363: +1, nesting level increased to 3

            } else if (!s.ok()) {
                   ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:367: +1, nesting level increased to 3

            } else if (eos) {
                   ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:372: +3, including nesting penalty of 2, nesting level increased to 3

                if (!s) {
                ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:383: +2, including nesting penalty of 1, nesting level increased to 2

            if (enable_http_send_block(*brpc_request)) {
            ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:384: +3, including nesting penalty of 2, nesting level increased to 3

                RETURN_IF_ERROR(transmit_block_httpv2(_context->exec_env(),
                ^

be/src/common/status.h:630: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:384: +4, including nesting penalty of 3, nesting level increased to 4

                RETURN_IF_ERROR(transmit_block_httpv2(_context->exec_env(),
                ^

be/src/common/status.h:632: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:387: +1, nesting level increased to 2

            } else {
              ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:392: +2, including nesting penalty of 1, nesting level increased to 2

        if (request.block_holder->get_block()) {
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:396: +1, nesting level increased to 1

    } else {
      ^

@Mryange
Copy link
Contributor Author

Mryange commented Nov 13, 2024

run buildall

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

@@ -211,8 +207,6 @@ Status ExchangeSinkBuffer::add_block(BroadcastTransmitInfo&& request) {
Status ExchangeSinkBuffer::_send_rpc(InstanceLoId id) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function '_send_rpc' has cognitive complexity of 70 (threshold 50) [readability-function-cognitive-complexity]

Status ExchangeSinkBuffer::_send_rpc(InstanceLoId id) {
                           ^
Additional context

be/src/pipeline/exec/exchange_sink_buffer.cpp:213: +1, including nesting penalty of 0, nesting level increased to 1

    if (_is_finishing) {
    ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:218: +1, including nesting penalty of 0, nesting level increased to 1

    if (!q.empty()) {
    ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:226: +2, including nesting penalty of 1, nesting level increased to 2

        if (request.block && !request.block->column_metas().empty()) {
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:226: +1

        if (request.block && !request.block->column_metas().empty()) {
                          ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:229: +2, including nesting penalty of 1, nesting level increased to 2

        if (!request.exec_status.ok()) {
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:235: +2, including nesting penalty of 1, nesting level increased to 2

        if (config::execution_ignore_eovercrowded) {
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:238: nesting level increased to 2

        send_callback->addFailedHandler([&, weak_task_ctx = weak_task_exec_ctx()](
                                        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:241: +3, including nesting penalty of 2, nesting level increased to 3

            if (task_lock == nullptr) {
            ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:250: nesting level increased to 2

        send_callback->addSuccessHandler([&, weak_task_ctx = weak_task_exec_ctx()](
                                         ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:255: +3, including nesting penalty of 2, nesting level increased to 3

            if (task_lock == nullptr) {
            ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:266: +3, including nesting penalty of 2, nesting level increased to 3

            if (s.is<ErrorCode::END_OF_FILE>()) {
            ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:268: +1, nesting level increased to 3

            } else if (!s.ok()) {
                   ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:272: +1, nesting level increased to 3

            } else if (eos) {
                   ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:277: +3, including nesting penalty of 2, nesting level increased to 3

                if (!s) {
                ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:288: +2, including nesting penalty of 1, nesting level increased to 2

            if (enable_http_send_block(*brpc_request)) {
            ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:289: +3, including nesting penalty of 2, nesting level increased to 3

                RETURN_IF_ERROR(transmit_block_httpv2(_context->exec_env(),
                ^

be/src/common/status.h:630: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:289: +4, including nesting penalty of 3, nesting level increased to 4

                RETURN_IF_ERROR(transmit_block_httpv2(_context->exec_env(),
                ^

be/src/common/status.h:632: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:292: +1, nesting level increased to 2

            } else {
              ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:297: +2, including nesting penalty of 1, nesting level increased to 2

        if (request.block) {
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:304: +2, including nesting penalty of 1, nesting level increased to 2

        if (_total_queue_size <= _queue_capacity) {
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:309: +1, nesting level increased to 1

    } else if (!broadcast_q.empty()) {
           ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:317: +2, including nesting penalty of 1, nesting level increased to 2

        if (request.block_holder->get_block() &&
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:317: +1

        if (request.block_holder->get_block() &&
                                              ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:323: +2, including nesting penalty of 1, nesting level increased to 2

        if (config::execution_ignore_eovercrowded) {
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:326: nesting level increased to 2

        send_callback->addFailedHandler([&, weak_task_ctx = weak_task_exec_ctx()](
                                        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:329: +3, including nesting penalty of 2, nesting level increased to 3

            if (task_lock == nullptr) {
            ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:338: nesting level increased to 2

        send_callback->addSuccessHandler([&, weak_task_ctx = weak_task_exec_ctx()](
                                         ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:343: +3, including nesting penalty of 2, nesting level increased to 3

            if (task_lock == nullptr) {
            ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:354: +3, including nesting penalty of 2, nesting level increased to 3

            if (s.is<ErrorCode::END_OF_FILE>()) {
            ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:356: +1, nesting level increased to 3

            } else if (!s.ok()) {
                   ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:360: +1, nesting level increased to 3

            } else if (eos) {
                   ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:365: +3, including nesting penalty of 2, nesting level increased to 3

                if (!s) {
                ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:376: +2, including nesting penalty of 1, nesting level increased to 2

            if (enable_http_send_block(*brpc_request)) {
            ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:377: +3, including nesting penalty of 2, nesting level increased to 3

                RETURN_IF_ERROR(transmit_block_httpv2(_context->exec_env(),
                ^

be/src/common/status.h:630: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:377: +4, including nesting penalty of 3, nesting level increased to 4

                RETURN_IF_ERROR(transmit_block_httpv2(_context->exec_env(),
                ^

be/src/common/status.h:632: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:380: +1, nesting level increased to 2

            } else {
              ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:385: +2, including nesting penalty of 1, nesting level increased to 2

        if (request.block_holder->get_block()) {
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:389: +1, nesting level increased to 1

    } else {
      ^

@Mryange
Copy link
Contributor Author

Mryange commented Nov 18, 2024

run buildall

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

@@ -211,8 +207,6 @@ Status ExchangeSinkBuffer::add_block(BroadcastTransmitInfo&& request) {
Status ExchangeSinkBuffer::_send_rpc(InstanceLoId id) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function '_send_rpc' has cognitive complexity of 74 (threshold 50) [readability-function-cognitive-complexity]

Status ExchangeSinkBuffer::_send_rpc(InstanceLoId id) {
                           ^
Additional context

be/src/pipeline/exec/exchange_sink_buffer.cpp:213: +1, including nesting penalty of 0, nesting level increased to 1

    if (_is_finishing) {
    ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:218: +1, including nesting penalty of 0, nesting level increased to 1

    if (!q.empty()) {
    ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:226: +2, including nesting penalty of 1, nesting level increased to 2

        if (request.block && !request.block->column_metas().empty()) {
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:226: +1

        if (request.block && !request.block->column_metas().empty()) {
                          ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:229: +2, including nesting penalty of 1, nesting level increased to 2

        if (!request.exec_status.ok()) {
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:235: +2, including nesting penalty of 1, nesting level increased to 2

        if (config::execution_ignore_eovercrowded) {
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:238: nesting level increased to 2

        send_callback->addFailedHandler([&, weak_task_ctx = weak_task_exec_ctx()](
                                        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:241: +3, including nesting penalty of 2, nesting level increased to 3

            if (task_lock == nullptr) {
            ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:250: nesting level increased to 2

        send_callback->addSuccessHandler([&, weak_task_ctx = weak_task_exec_ctx()](
                                         ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:255: +3, including nesting penalty of 2, nesting level increased to 3

            if (task_lock == nullptr) {
            ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:266: +3, including nesting penalty of 2, nesting level increased to 3

            if (s.is<ErrorCode::END_OF_FILE>()) {
            ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:267: +1, nesting level increased to 3

            } else if (!s.ok()) {
                   ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:272: +3, including nesting penalty of 2, nesting level increased to 3

            if (eos) {
            ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:277: +3, including nesting penalty of 2, nesting level increased to 3

                if (!s) {
                ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:288: +2, including nesting penalty of 1, nesting level increased to 2

            if (enable_http_send_block(*brpc_request)) {
            ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:289: +3, including nesting penalty of 2, nesting level increased to 3

                RETURN_IF_ERROR(transmit_block_httpv2(_context->exec_env(),
                ^

be/src/common/status.h:631: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:289: +4, including nesting penalty of 3, nesting level increased to 4

                RETURN_IF_ERROR(transmit_block_httpv2(_context->exec_env(),
                ^

be/src/common/status.h:633: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:292: +1, nesting level increased to 2

            } else {
              ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:297: +2, including nesting penalty of 1, nesting level increased to 2

        if (request.block) {
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:304: +2, including nesting penalty of 1, nesting level increased to 2

        if (_total_queue_size <= _queue_capacity) {
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:309: +1, nesting level increased to 1

    } else if (!broadcast_q.empty()) {
           ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:317: +2, including nesting penalty of 1, nesting level increased to 2

        if (request.block_holder->get_block() &&
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:317: +1

        if (request.block_holder->get_block() &&
                                              ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:323: +2, including nesting penalty of 1, nesting level increased to 2

        if (config::execution_ignore_eovercrowded) {
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:326: nesting level increased to 2

        send_callback->addFailedHandler([&, weak_task_ctx = weak_task_exec_ctx()](
                                        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:329: +3, including nesting penalty of 2, nesting level increased to 3

            if (task_lock == nullptr) {
            ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:338: nesting level increased to 2

        send_callback->addSuccessHandler([&, weak_task_ctx = weak_task_exec_ctx()](
                                         ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:343: +3, including nesting penalty of 2, nesting level increased to 3

            if (task_lock == nullptr) {
            ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:354: +3, including nesting penalty of 2, nesting level increased to 3

            if (s.is<ErrorCode::END_OF_FILE>()) {
            ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:355: +1, nesting level increased to 3

            } else if (!s.ok()) {
                   ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:360: +3, including nesting penalty of 2, nesting level increased to 3

            if (eos) {
            ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:365: +3, including nesting penalty of 2, nesting level increased to 3

                if (!s) {
                ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:376: +2, including nesting penalty of 1, nesting level increased to 2

            if (enable_http_send_block(*brpc_request)) {
            ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:377: +3, including nesting penalty of 2, nesting level increased to 3

                RETURN_IF_ERROR(transmit_block_httpv2(_context->exec_env(),
                ^

be/src/common/status.h:631: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:377: +4, including nesting penalty of 3, nesting level increased to 4

                RETURN_IF_ERROR(transmit_block_httpv2(_context->exec_env(),
                ^

be/src/common/status.h:633: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:380: +1, nesting level increased to 2

            } else {
              ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:385: +2, including nesting penalty of 1, nesting level increased to 2

        if (request.block_holder->get_block()) {
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:389: +1, nesting level increased to 1

    } else {
      ^

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

@@ -211,8 +207,6 @@ Status ExchangeSinkBuffer::add_block(BroadcastTransmitInfo&& request) {
Status ExchangeSinkBuffer::_send_rpc(InstanceLoId id) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function '_send_rpc' has cognitive complexity of 74 (threshold 50) [readability-function-cognitive-complexity]

Status ExchangeSinkBuffer::_send_rpc(InstanceLoId id) {
                           ^
Additional context

be/src/pipeline/exec/exchange_sink_buffer.cpp:213: +1, including nesting penalty of 0, nesting level increased to 1

    if (_is_finishing) {
    ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:218: +1, including nesting penalty of 0, nesting level increased to 1

    if (!q.empty()) {
    ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:226: +2, including nesting penalty of 1, nesting level increased to 2

        if (request.block && !request.block->column_metas().empty()) {
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:226: +1

        if (request.block && !request.block->column_metas().empty()) {
                          ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:229: +2, including nesting penalty of 1, nesting level increased to 2

        if (!request.exec_status.ok()) {
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:235: +2, including nesting penalty of 1, nesting level increased to 2

        if (config::execution_ignore_eovercrowded) {
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:238: nesting level increased to 2

        send_callback->addFailedHandler([&, weak_task_ctx = weak_task_exec_ctx()](
                                        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:241: +3, including nesting penalty of 2, nesting level increased to 3

            if (task_lock == nullptr) {
            ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:250: nesting level increased to 2

        send_callback->addSuccessHandler([&, weak_task_ctx = weak_task_exec_ctx()](
                                         ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:255: +3, including nesting penalty of 2, nesting level increased to 3

            if (task_lock == nullptr) {
            ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:266: +3, including nesting penalty of 2, nesting level increased to 3

            if (s.is<ErrorCode::END_OF_FILE>()) {
            ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:267: +1, nesting level increased to 3

            } else if (!s.ok()) {
                   ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:272: +3, including nesting penalty of 2, nesting level increased to 3

            if (eos) {
            ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:277: +3, including nesting penalty of 2, nesting level increased to 3

                if (!s) {
                ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:288: +2, including nesting penalty of 1, nesting level increased to 2

            if (enable_http_send_block(*brpc_request)) {
            ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:289: +3, including nesting penalty of 2, nesting level increased to 3

                RETURN_IF_ERROR(transmit_block_httpv2(_context->exec_env(),
                ^

be/src/common/status.h:632: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:289: +4, including nesting penalty of 3, nesting level increased to 4

                RETURN_IF_ERROR(transmit_block_httpv2(_context->exec_env(),
                ^

be/src/common/status.h:634: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:292: +1, nesting level increased to 2

            } else {
              ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:297: +2, including nesting penalty of 1, nesting level increased to 2

        if (request.block) {
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:304: +2, including nesting penalty of 1, nesting level increased to 2

        if (_total_queue_size <= _queue_capacity) {
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:309: +1, nesting level increased to 1

    } else if (!broadcast_q.empty()) {
           ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:317: +2, including nesting penalty of 1, nesting level increased to 2

        if (request.block_holder->get_block() &&
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:317: +1

        if (request.block_holder->get_block() &&
                                              ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:323: +2, including nesting penalty of 1, nesting level increased to 2

        if (config::execution_ignore_eovercrowded) {
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:326: nesting level increased to 2

        send_callback->addFailedHandler([&, weak_task_ctx = weak_task_exec_ctx()](
                                        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:329: +3, including nesting penalty of 2, nesting level increased to 3

            if (task_lock == nullptr) {
            ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:338: nesting level increased to 2

        send_callback->addSuccessHandler([&, weak_task_ctx = weak_task_exec_ctx()](
                                         ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:343: +3, including nesting penalty of 2, nesting level increased to 3

            if (task_lock == nullptr) {
            ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:354: +3, including nesting penalty of 2, nesting level increased to 3

            if (s.is<ErrorCode::END_OF_FILE>()) {
            ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:355: +1, nesting level increased to 3

            } else if (!s.ok()) {
                   ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:360: +3, including nesting penalty of 2, nesting level increased to 3

            if (eos) {
            ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:365: +3, including nesting penalty of 2, nesting level increased to 3

                if (!s) {
                ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:376: +2, including nesting penalty of 1, nesting level increased to 2

            if (enable_http_send_block(*brpc_request)) {
            ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:377: +3, including nesting penalty of 2, nesting level increased to 3

                RETURN_IF_ERROR(transmit_block_httpv2(_context->exec_env(),
                ^

be/src/common/status.h:632: expanded from macro 'RETURN_IF_ERROR'

    do {                                \
    ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:377: +4, including nesting penalty of 3, nesting level increased to 4

                RETURN_IF_ERROR(transmit_block_httpv2(_context->exec_env(),
                ^

be/src/common/status.h:634: expanded from macro 'RETURN_IF_ERROR'

        if (UNLIKELY(!_status_.ok())) { \
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:380: +1, nesting level increased to 2

            } else {
              ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:385: +2, including nesting penalty of 1, nesting level increased to 2

        if (request.block_holder->get_block()) {
        ^

be/src/pipeline/exec/exchange_sink_buffer.cpp:389: +1, nesting level increased to 1

    } else {
      ^

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 37.97% (9896/26063)
Line Coverage: 29.17% (82734/283656)
Region Coverage: 28.31% (42488/150082)
Branch Coverage: 24.87% (21540/86594)
Coverage Report: http://coverage.selectdb-in.cc/coverage/30c4a11728219e24a1bb97044d7ec937af8763f0_30c4a11728219e24a1bb97044d7ec937af8763f0/report/index.html

@Mryange
Copy link
Contributor Author

Mryange commented Nov 18, 2024

run buildall

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 38.00% (9897/26043)
Line Coverage: 29.18% (82750/283564)
Region Coverage: 28.32% (42496/150072)
Branch Coverage: 24.88% (21551/86606)
Coverage Report: http://coverage.selectdb-in.cc/coverage/12e53915894485762dc1e7de8804d53dffe71f87_12e53915894485762dc1e7de8804d53dffe71f87/report/index.html

@Mryange Mryange closed this Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants