rocketmq
rocketmq copied to clipboard
using take replace poll
Make sure set the target branch to develop
What is the purpose of the change
XXXXX
Brief changelog
XX
Verifying this change
XXXX
Follow this checklist to help us incorporate your contribution quickly and easily. Notice, it would be helpful if you could finish the following 5 checklist(the last one is not necessary)before request the community to review your PR
.
- [x] Make sure there is a Github issue filed for the change (usually before you start working on it). Trivial changes like typos do not require a Github issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
- [x] Format the pull request title like
[ISSUE #123] Fix UnknownException when host config not exist
. Each commit in the pull request should have a meaningful subject line and body. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit-test(over 80% coverage) to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add integration-test in test module.
- [x] Run
mvn -B clean apache-rat:check findbugs:findbugs checkstyle:checkstyle
to make sure basic checks pass. Runmvn clean install -DskipITs
to make sure unit-test pass. Runmvn clean test-compile failsafe:integration-test
to make sure integration-test pass. - [ ] If this contribution is large, please file an Apache Individual Contributor License Agreement.
use less cpu
org/apache/rocketmq/namesrv/routeinfo/BatchUnRegisterService.java:63
while (!this.isStopped()) {
use poll can make thread graceful stop. maybe this is the original intention
it may be more graceful to replace this.unRegisterService.shutdown(true) with this.unRegisterService.shutdown()
replacing poll() is better than replacing this.unRegisterService.shutdown() because the queue is empty most of the time
@kang-hl Please rebase to the latest develop
branch to trigger CI checks that are required to merge this pull request.
Codecov Report
Merging #4754 (792c7b4) into develop (74bae19) will increase coverage by
0.05%
. The diff coverage is100.00%
.
@@ Coverage Diff @@
## develop #4754 +/- ##
=============================================
+ Coverage 43.17% 43.23% +0.05%
- Complexity 7717 7730 +13
=============================================
Files 995 995
Lines 69066 69065 -1
Branches 9144 9143 -1
=============================================
+ Hits 29818 29859 +41
+ Misses 35506 35467 -39
+ Partials 3742 3739 -3
Impacted Files | Coverage Δ | |
---|---|---|
...etmq/namesrv/routeinfo/BatchUnRegisterService.java | 100.00% <100.00%> (+5.26%) |
:arrow_up: |
.../org/apache/rocketmq/store/ha/DefaultHAClient.java | 58.97% <0.00%> (-2.57%) |
:arrow_down: |
...va/org/apache/rocketmq/common/stats/StatsItem.java | 50.00% <0.00%> (-2.50%) |
:arrow_down: |
...main/java/org/apache/rocketmq/store/CommitLog.java | 68.57% <0.00%> (-0.19%) |
:arrow_down: |
.../org/apache/rocketmq/proxy/config/ProxyConfig.java | 48.96% <0.00%> (ø) |
|
.../apache/rocketmq/logging/inner/LoggingBuilder.java | 63.92% <0.00%> (+0.31%) |
:arrow_up: |
...he/rocketmq/client/trace/AsyncTraceDispatcher.java | 83.33% <0.00%> (+0.47%) |
:arrow_up: |
...rocketmq/broker/processor/PopMessageProcessor.java | 38.17% <0.00%> (+0.53%) |
:arrow_up: |
...ent/impl/consumer/DefaultLitePullConsumerImpl.java | 70.00% <0.00%> (+0.62%) |
:arrow_up: |
...client/consumer/store/RemoteBrokerOffsetStore.java | 69.29% <0.00%> (+0.87%) |
:arrow_up: |
... and 7 more |
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more