You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "BiteTheDDDDt (via GitHub)" <gi...@apache.org> on 2025/11/04 07:58:35 UTC

[PR] [Chore](exchange) reduce create wait_channel_timer [doris]

BiteTheDDDDt opened a new pull request, #57683:
URL: https://github.com/apache/doris/pull/57683

   ### What problem does this PR solve?
   Currently, the number of our wait_channel_timers corresponds to the number of `channels`. After the modifications in this PR, the number of wait_channel_timers will align with the number of `local channels`, thereby reducing unnecessary timer generation.
   
   This pull request refactors and improves code readability and safety in the `exchange_sink_operator.cpp` file by modernizing loop constructs, improving memory management, and enhancing error handling. The changes mainly focus on using range-based loops, smart pointers, and clearer logic for managing channel dependencies and timers.
   
   **Code modernization and safety improvements:**
   
   * Replaced traditional for-loops with range-based for-loops for iterating over `channels`, improving readability and reducing indexing errors in multiple methods (`init`, `open`). [[1]](diffhunk://#diff-70038347289359e40966cf399f9a4165f6423f3634ceb13d496da4d4627ce073L85-R86) [[2]](diffhunk://#diff-70038347289359e40966cf399f9a4165f6423f3634ceb13d496da4d4627ce073L217-R217)
   * Updated memory management for `_writer` by switching from manual `reset` with `new` to `std::make_unique`, ensuring exception safety and clarity.
   * Used `contains` method instead of `find` for map lookups in `_create_channels`, making the code more concise and modern.
   * Changed range-based loop in the constructor to use `const auto&` for safety and clarity.
   
   **Dependency and error handling improvements:**
   
   * Added a null pointer check for local channel dependencies and improved timer management, ensuring that dependencies are valid and timers are only added for non-null dependencies.
   ### Check List (For Author)
   
   - Test <!-- At least one of them must be included. -->
       - [ ] 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 <!-- Add your reason?  -->
   
   - Behavior changed:
       - [ ] No.
       - [ ] Yes. <!-- Explain the behavior change -->
   
   - Does this need documentation?
       - [ ] No.
       - [ ] Yes. <!-- Add document PR link here. eg: https://github.com/apache/doris-website/pull/1214 -->
   
   ### Check List (For Reviewer who merge this PR)
   
   - [ ] Confirm the release note
   - [ ] Confirm test cases
   - [ ] Confirm document
   - [ ] Add branch pick label <!-- Add branch pick label that this PR should merge into -->
   
   


-- 
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] [Chore](exchange) reduce create wait_channel_timer [doris]

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

   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] [Chore](exchange) reduce create wait_channel_timer [doris]

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

   # BE Regression && UT Coverage Report
   Increment line coverage `85.71% (12/14)` :tada:
   
   [Increment coverage report](http://coverage.selectdb-in.cc/coverage/57683_81cd6433ef985907c566cfc4f49f30cc25a07fb6_merge/increment_report/index.html)
   [Complete coverage report](http://coverage.selectdb-in.cc/coverage/57683_81cd6433ef985907c566cfc4f49f30cc25a07fb6_merge/report/index.html)
   | Category          | Coverage           |
   |-------------------|--------------------|
   | Function Coverage | 71.49% (24095/33706) |
   | Line Coverage     | 57.91% (250730/432986) |
   | Region Coverage   | 52.82% (207496/392846) |
   | Branch Coverage   | 54.67% (89388/163496) |


-- 
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] [Chore](exchange) reduce create wait_channel_timer [doris]

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

   PR approved by at least one committer and no changes requested.


-- 
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] [Chore](exchange) reduce create wait_channel_timer [doris]

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


-- 
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] [Chore](exchange) reduce create wait_channel_timer [doris]

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

   
   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).
   
   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?
       


-- 
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] [Chore](exchange) reduce create wait_channel_timer [doris]

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

   PR approved by anyone and no changes requested.


-- 
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] [Chore](exchange) reduce create wait_channel_timer [doris]

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

   # BE UT Coverage Report
   Increment line coverage `78.57% (11/14)` :tada:
   
   [Increment coverage report](http://coverage.selectdb-in.cc/coverage/81cd6433ef985907c566cfc4f49f30cc25a07fb6_81cd6433ef985907c566cfc4f49f30cc25a07fb6/increment_report/index.html)
   [Complete coverage report](http://coverage.selectdb-in.cc/coverage/81cd6433ef985907c566cfc4f49f30cc25a07fb6_81cd6433ef985907c566cfc4f49f30cc25a07fb6/report/index.html)
   | Category          | Coverage           |
   |-------------------|--------------------|
   | Function Coverage | 52.73% (18079/34287) |
   | Line Coverage     | 38.05% (164452/432241) |
   | Region Coverage   | 32.36% (125314/387250) |
   | Branch Coverage   | 33.80% (54892/162387) |


-- 
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