You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "zhiqiang-hhhh (via GitHub)" <gi...@apache.org> on 2024/09/10 16:35:02 UTC

[PR] [fix](scanner) Fix deadlock when scanner submit failed #40495 [doris]

zhiqiang-hhhh opened a new pull request, #40640:
URL: https://github.com/apache/doris/pull/40640

   cherry pick from #40495


-- 
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-unsubscribe@doris.apache.org

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


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


Re: [PR] [fix](scanner) Fix deadlock when scanner submit failed #40495 [doris]

Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #40640:
URL: https://github.com/apache/doris/pull/40640#issuecomment-2341443045

   Thank you for your contribution to Apache Doris.
   Don't know what should be done next? See [How to process your PR](https://cwiki.apache.org/confluence/display/DORIS/How+to+process+your+PR)
   
   Since 2024-03-18, the Document has been moved to [doris-website](https://github.com/apache/doris-website).
   See [Doris Document](https://cwiki.apache.org/confluence/display/DORIS/Doris+Document).


-- 
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-unsubscribe@doris.apache.org

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


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


Re: [PR] [fix](scanner) Fix deadlock when scanner submit failed #40495 [doris]

Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #40640:
URL: https://github.com/apache/doris/pull/40640#issuecomment-2341539090

   TeamCity be ut coverage result:
    Function Coverage: 36.18% (9319/25759) 
    Line Coverage: 27.72% (76429/275695)
    Region Coverage: 26.52% (39251/147990)
    Branch Coverage: 23.36% (20030/85736)
    Coverage Report: http://coverage.selectdb-in.cc/coverage/3cc37c50efc8f385d7c771ced0d60c7d4c400c5d_3cc37c50efc8f385d7c771ced0d60c7d4c400c5d/report/index.html


-- 
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-unsubscribe@doris.apache.org

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


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


Re: [PR] [fix](scanner) Fix deadlock when scanner submit failed #40495 [doris]

Posted by "zhiqiang-hhhh (via GitHub)" <gi...@apache.org>.
zhiqiang-hhhh commented on PR #40640:
URL: https://github.com/apache/doris/pull/40640#issuecomment-2341442912

   run buildall


-- 
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-unsubscribe@doris.apache.org

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


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


Re: [PR] [fix](scanner) Fix deadlock when scanner submit failed #40495 [doris]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on code in PR #40640:
URL: https://github.com/apache/doris/pull/40640#discussion_r1752307181


##########
be/src/vec/exec/scan/scanner_scheduler.cpp:
##########
@@ -119,23 +119,23 @@ Status ScannerScheduler::init(ExecEnv* env) {
     return Status::OK();
 }
 
-void ScannerScheduler::submit(std::shared_ptr<ScannerContext> ctx,
-                              std::shared_ptr<ScanTask> scan_task) {
+Status ScannerScheduler::submit(std::shared_ptr<ScannerContext> ctx,

Review Comment:
   warning: function 'submit' has cognitive complexity of 58 (threshold 50) [readability-function-cognitive-complexity]
   ```cpp
   Status ScannerScheduler::submit(std::shared_ptr<ScannerContext> ctx,
                            ^
   ```
   <details>
   <summary>Additional context</summary>
   
   **be/src/vec/exec/scan/scanner_scheduler.cpp:124:** +1, including nesting penalty of 0, nesting level increased to 1
   ```cpp
       if (ctx->done()) {
       ^
   ```
   **be/src/vec/exec/scan/scanner_scheduler.cpp:128:** +1, including nesting penalty of 0, nesting level increased to 1
   ```cpp
       if (task_lock == nullptr) {
       ^
   ```
   **be/src/vec/exec/scan/scanner_scheduler.cpp:134:** +1, including nesting penalty of 0, nesting level increased to 1
   ```cpp
       if (ctx->thread_token != nullptr) {
       ^
   ```
   **be/src/vec/exec/scan/scanner_scheduler.cpp:136:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
           if (scanner_delegate == nullptr) {
           ^
   ```
   **be/src/vec/exec/scan/scanner_scheduler.cpp:141:** nesting level increased to 2
   ```cpp
           auto s = ctx->thread_token->submit_func([scanner_ref = scan_task, ctx]() {
                                                   ^
   ```
   **be/src/vec/exec/scan/scanner_scheduler.cpp:142:** nesting level increased to 3
   ```cpp
               auto status = [&] {
                             ^
   ```
   **be/src/vec/exec/scan/scanner_scheduler.cpp:143:** +4, including nesting penalty of 3, nesting level increased to 4
   ```cpp
                   RETURN_IF_CATCH_EXCEPTION(_scanner_scan(ctx, scanner_ref));
                   ^
   ```
   **be/src/common/exception.h:89:** expanded from macro 'RETURN_IF_CATCH_EXCEPTION'
   ```cpp
       do {                                                                                         \
       ^
   ```
   **be/src/vec/exec/scan/scanner_scheduler.cpp:143:** +5, including nesting penalty of 4, nesting level increased to 5
   ```cpp
                   RETURN_IF_CATCH_EXCEPTION(_scanner_scan(ctx, scanner_ref));
                   ^
   ```
   **be/src/common/exception.h:94:** expanded from macro 'RETURN_IF_CATCH_EXCEPTION'
   ```cpp
           } catch (const doris::Exception& e) {                                                    \
             ^
   ```
   **be/src/vec/exec/scan/scanner_scheduler.cpp:143:** +6, including nesting penalty of 5, nesting level increased to 6
   ```cpp
                   RETURN_IF_CATCH_EXCEPTION(_scanner_scan(ctx, scanner_ref));
                   ^
   ```
   **be/src/common/exception.h:95:** expanded from macro 'RETURN_IF_CATCH_EXCEPTION'
   ```cpp
               if (e.code() == doris::ErrorCode::MEM_ALLOC_FAILED) {                                \
               ^
   ```
   **be/src/vec/exec/scan/scanner_scheduler.cpp:147:** +3, including nesting penalty of 2, nesting level increased to 3
   ```cpp
               if (!status.ok()) {
               ^
   ```
   **be/src/vec/exec/scan/scanner_scheduler.cpp:152:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
           if (!s.ok()) {
           ^
   ```
   **be/src/vec/exec/scan/scanner_scheduler.cpp:156:** +1, nesting level increased to 1
   ```cpp
       } else {
         ^
   ```
   **be/src/vec/exec/scan/scanner_scheduler.cpp:158:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
           if (scanner_delegate == nullptr) {
           ^
   ```
   **be/src/vec/exec/scan/scanner_scheduler.cpp:164:** nesting level increased to 2
   ```cpp
           auto sumbit_task = [&]() {
                              ^
   ```
   **be/src/vec/exec/scan/scanner_scheduler.cpp:167:** +3, including nesting penalty of 2, nesting level increased to 3
   ```cpp
                       is_local ? ctx->get_simple_scan_scheduler() : ctx->get_remote_scan_scheduler();
                                ^
   ```
   **be/src/vec/exec/scan/scanner_scheduler.cpp:168:** +3, including nesting penalty of 2, nesting level increased to 3
   ```cpp
               if (!scan_sched) { // query without workload group
               ^
   ```
   **be/src/vec/exec/scan/scanner_scheduler.cpp:172:** nesting level increased to 3
   ```cpp
               auto work_func = [scanner_ref = scan_task, ctx]() {
                                ^
   ```
   **be/src/vec/exec/scan/scanner_scheduler.cpp:173:** nesting level increased to 4
   ```cpp
                   auto status = [&] {
                                 ^
   ```
   **be/src/vec/exec/scan/scanner_scheduler.cpp:174:** +5, including nesting penalty of 4, nesting level increased to 5
   ```cpp
                       RETURN_IF_CATCH_EXCEPTION(_scanner_scan(ctx, scanner_ref));
                       ^
   ```
   **be/src/common/exception.h:89:** expanded from macro 'RETURN_IF_CATCH_EXCEPTION'
   ```cpp
       do {                                                                                         \
       ^
   ```
   **be/src/vec/exec/scan/scanner_scheduler.cpp:174:** +6, including nesting penalty of 5, nesting level increased to 6
   ```cpp
                       RETURN_IF_CATCH_EXCEPTION(_scanner_scan(ctx, scanner_ref));
                       ^
   ```
   **be/src/common/exception.h:94:** expanded from macro 'RETURN_IF_CATCH_EXCEPTION'
   ```cpp
           } catch (const doris::Exception& e) {                                                    \
             ^
   ```
   **be/src/vec/exec/scan/scanner_scheduler.cpp:174:** +7, including nesting penalty of 6, nesting level increased to 7
   ```cpp
                       RETURN_IF_CATCH_EXCEPTION(_scanner_scan(ctx, scanner_ref));
                       ^
   ```
   **be/src/common/exception.h:95:** expanded from macro 'RETURN_IF_CATCH_EXCEPTION'
   ```cpp
               if (e.code() == doris::ErrorCode::MEM_ALLOC_FAILED) {                                \
               ^
   ```
   **be/src/vec/exec/scan/scanner_scheduler.cpp:178:** +4, including nesting penalty of 3, nesting level increased to 4
   ```cpp
                   if (!status.ok()) {
                   ^
   ```
   **be/src/vec/exec/scan/scanner_scheduler.cpp:188:** +2, including nesting penalty of 1, nesting level increased to 2
   ```cpp
           if (!submit_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-unsubscribe@doris.apache.org

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


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


Re: [PR] [fix](scanner) Fix deadlock when scanner submit failed #40495 [doris]

Posted by "yiguolei (via GitHub)" <gi...@apache.org>.
yiguolei merged PR #40640:
URL: https://github.com/apache/doris/pull/40640


-- 
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-unsubscribe@doris.apache.org

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


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