You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "crzbird (via GitHub)" <gi...@apache.org> on 2023/03/23 09:51:18 UTC

[GitHub] [rocketmq] crzbird opened a new pull request, #6457: [ISSUE #6456] Fix ConsumeMessageService#updateCorePoolSize: Can not i…

crzbird opened a new pull request, #6457:
URL: https://github.com/apache/rocketmq/pull/6457

   …ncrease consumeExecutor coreSize.
   
   
   **Make sure set the target branch to `develop`**
   
   ## What is the purpose of the change
   
   <!--
   If this PR fixes a GitHub issue, please add `fixes #<XXX>` or `closes #<XXX>`. Please refer to the documentation for more information:
   https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue
   -->
   
   fix #6456
   
   ## Brief changelog
   
   fix method "updateCorePoolSize" of ConsumeMessageConcurrentlyService&ConsumeMessageOrderlyService&ConsumeMessagePopConcurrentlyService&ConsumeMessagePopOrderlyService.
   make it support increase consumeExecutor coreSize.
   
   
   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](https://github.com/apache/rocketmq/issues) 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](https://github.com/apache/rocketmq/tree/master/test).
   - [x] Run `mvn -B clean apache-rat:check findbugs:findbugs checkstyle:checkstyle` to make sure basic checks pass. Run `mvn clean install -DskipITs` to make sure unit-test pass. Run `mvn 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](http://www.apache.org/licenses/#clas).
   


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

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


[GitHub] [rocketmq] codecov-commenter commented on pull request #6457: [ISSUE #6456] Fix ConsumeMessageService#updateCorePoolSize: Can not i…

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #6457:
URL: https://github.com/apache/rocketmq/pull/6457#issuecomment-1481196616

   ## [Codecov](https://codecov.io/gh/apache/rocketmq/pull/6457?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#6457](https://codecov.io/gh/apache/rocketmq/pull/6457?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (fc7a747) into [develop](https://codecov.io/gh/apache/rocketmq/commit/0faa0a2c7db85f6c2377eb3d961dc5622c47adc8?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (0faa0a2) will **decrease** coverage by `0.03%`.
   > The diff coverage is `0.00%`.
   
   ```diff
   @@              Coverage Diff              @@
   ##             develop    #6457      +/-   ##
   =============================================
   - Coverage      43.21%   43.18%   -0.03%     
   + Complexity      9004     9001       -3     
   =============================================
     Files           1105     1105              
     Lines          78076    78076              
     Branches       10166    10162       -4     
   =============================================
   - Hits           33737    33721      -16     
   - Misses         40119    40130      +11     
   - Partials        4220     4225       +5     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/rocketmq/pull/6457?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...pl/consumer/ConsumeMessageConcurrentlyService.java](https://codecov.io/gh/apache/rocketmq/pull/6457?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9jbGllbnQvaW1wbC9jb25zdW1lci9Db25zdW1lTWVzc2FnZUNvbmN1cnJlbnRseVNlcnZpY2UuamF2YQ==) | `46.33% <0.00%> (ø)` | |
   | [...nt/impl/consumer/ConsumeMessageOrderlyService.java](https://codecov.io/gh/apache/rocketmq/pull/6457?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9jbGllbnQvaW1wbC9jb25zdW1lci9Db25zdW1lTWVzc2FnZU9yZGVybHlTZXJ2aWNlLmphdmE=) | `49.64% <0.00%> (ø)` | |
   | [...consumer/ConsumeMessagePopConcurrentlyService.java](https://codecov.io/gh/apache/rocketmq/pull/6457?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9jbGllbnQvaW1wbC9jb25zdW1lci9Db25zdW1lTWVzc2FnZVBvcENvbmN1cnJlbnRseVNlcnZpY2UuamF2YQ==) | `5.70% <0.00%> (ø)` | |
   | [...impl/consumer/ConsumeMessagePopOrderlyService.java](https://codecov.io/gh/apache/rocketmq/pull/6457?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9jbGllbnQvaW1wbC9jb25zdW1lci9Db25zdW1lTWVzc2FnZVBvcE9yZGVybHlTZXJ2aWNlLmphdmE=) | `12.22% <0.00%> (ø)` | |
   
   ... and [18 files with indirect coverage changes](https://codecov.io/gh/apache/rocketmq/pull/6457/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


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

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


[GitHub] [rocketmq] crzbird commented on pull request #6457: [ISSUE #6456] Fix ConsumeMessageService#updateCorePoolSize: Can not i…

Posted by "crzbird (via GitHub)" <gi...@apache.org>.
crzbird commented on PR #6457:
URL: https://github.com/apache/rocketmq/pull/6457#issuecomment-1483979935

   I recognize this issue cause by rocketmq-spring,@interface RocketMQMessageListener use consumeThreadNumber() as consumeExecutor coreSize and maximumSize, two property has same value cause this issue.I've submit a PR to rocketmq-spring.
   By the way ,this PR optimize ConsumeMessageService#updateCorePoolSize as well.


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

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


Re: [PR] [ISSUE #6456] Fix ConsumeMessageService#updateCorePoolSize: Can not i… [rocketmq]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #6457: [ISSUE #6456] Fix ConsumeMessageService#updateCorePoolSize: Can not i…
URL: https://github.com/apache/rocketmq/pull/6457


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

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


[GitHub] [rocketmq] github-code-scanning[bot] commented on pull request #6457: [ISSUE #6456] Fix ConsumeMessageService#updateCorePoolSize: Can not i…

Posted by "github-code-scanning[bot] (via GitHub)" <gi...@apache.org>.
github-code-scanning[bot] commented on PR #6457:
URL: https://github.com/apache/rocketmq/pull/6457#issuecomment-1481142094

   You have successfully added a new CodeQL configuration `.github/workflows/codeql_analysis.yml:CodeQL-Build`. As part of the setup process, we have scanned this repository and found 9 existing alerts. Please check the repository [Security tab](/apache/rocketmq/security/code-scanning?query=pr%3A6457+tool%3ACodeQL+is%3Aopen) to see all alerts.


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

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


[GitHub] [rocketmq] lizhanhui commented on a diff in pull request #6457: [ISSUE #6456] Fix ConsumeMessageService#updateCorePoolSize: Can not i…

Posted by "lizhanhui (via GitHub)" <gi...@apache.org>.
lizhanhui commented on code in PR #6457:
URL: https://github.com/apache/rocketmq/pull/6457#discussion_r1147050173


##########
client/src/main/java/org/apache/rocketmq/client/impl/consumer/ConsumeMessagePopConcurrentlyService.java:
##########
@@ -91,9 +91,11 @@ public void shutdown(long awaitTerminateMillis) {
 
     @Override
     public void updateCorePoolSize(int corePoolSize) {
-        if (corePoolSize > 0
-            && corePoolSize <= Short.MAX_VALUE
-            && corePoolSize < this.defaultMQPushConsumer.getConsumeThreadMax()) {
+        if (corePoolSize > 0 && corePoolSize != this.consumeExecutor.getCorePoolSize()
+                && corePoolSize <= Short.MAX_VALUE) {
+            if (corePoolSize > this.consumeExecutor.getMaximumPoolSize()) {
+                this.consumeExecutor.setMaximumPoolSize(corePoolSize);
+            }

Review Comment:
   Same here



##########
client/src/main/java/org/apache/rocketmq/client/impl/consumer/ConsumeMessagePopOrderlyService.java:
##########
@@ -109,9 +109,11 @@ public synchronized void unlockAllMessageQueues() {
 
     @Override
     public void updateCorePoolSize(int corePoolSize) {
-        if (corePoolSize > 0
-            && corePoolSize <= Short.MAX_VALUE
-            && corePoolSize < this.defaultMQPushConsumer.getConsumeThreadMax()) {
+        if (corePoolSize > 0 && corePoolSize != this.consumeExecutor.getCorePoolSize()
+                && corePoolSize <= Short.MAX_VALUE) {
+            if (corePoolSize > this.consumeExecutor.getMaximumPoolSize()) {
+                this.consumeExecutor.setMaximumPoolSize(corePoolSize);
+            }

Review Comment:
   Same here



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

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


[GitHub] [rocketmq] lizhanhui commented on a diff in pull request #6457: [ISSUE #6456] Fix ConsumeMessageService#updateCorePoolSize: Can not i…

Posted by "lizhanhui (via GitHub)" <gi...@apache.org>.
lizhanhui commented on code in PR #6457:
URL: https://github.com/apache/rocketmq/pull/6457#discussion_r1147050064


##########
client/src/main/java/org/apache/rocketmq/client/impl/consumer/ConsumeMessageOrderlyService.java:
##########
@@ -115,9 +115,11 @@ public synchronized void unlockAllMQ() {
 
     @Override
     public void updateCorePoolSize(int corePoolSize) {
-        if (corePoolSize > 0
-            && corePoolSize <= Short.MAX_VALUE
-            && corePoolSize < this.defaultMQPushConsumer.getConsumeThreadMax()) {
+        if (corePoolSize > 0 && corePoolSize != this.consumeExecutor.getCorePoolSize()
+                && corePoolSize <= Short.MAX_VALUE) {
+            if (corePoolSize > this.consumeExecutor.getMaximumPoolSize()) {
+                this.consumeExecutor.setMaximumPoolSize(corePoolSize);
+            }

Review Comment:
   Same here



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

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


Re: [PR] [ISSUE #6456] Fix ConsumeMessageService#updateCorePoolSize: Can not i… [rocketmq]

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

   This PR was closed because it has been inactive for 3 days since being marked as stale.


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

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


[GitHub] [rocketmq] lizhanhui commented on a diff in pull request #6457: [ISSUE #6456] Fix ConsumeMessageService#updateCorePoolSize: Can not i…

Posted by "lizhanhui (via GitHub)" <gi...@apache.org>.
lizhanhui commented on code in PR #6457:
URL: https://github.com/apache/rocketmq/pull/6457#discussion_r1147049959


##########
client/src/main/java/org/apache/rocketmq/client/impl/consumer/ConsumeMessageConcurrentlyService.java:
##########
@@ -105,9 +105,11 @@ public void shutdown(long awaitTerminateMillis) {
 
     @Override
     public void updateCorePoolSize(int corePoolSize) {
-        if (corePoolSize > 0
-            && corePoolSize <= Short.MAX_VALUE
-            && corePoolSize < this.defaultMQPushConsumer.getConsumeThreadMax()) {
+        if (corePoolSize > 0 && corePoolSize != this.consumeExecutor.getCorePoolSize()
+                && corePoolSize <= Short.MAX_VALUE) {
+            if (corePoolSize > this.consumeExecutor.getMaximumPoolSize()) {
+                this.consumeExecutor.setMaximumPoolSize(corePoolSize);
+            }

Review Comment:
   Need an else here or return early.



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

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


[GitHub] [rocketmq] crzbird commented on a diff in pull request #6457: [ISSUE #6456] Fix ConsumeMessageService#updateCorePoolSize: Can not i…

Posted by "crzbird (via GitHub)" <gi...@apache.org>.
crzbird commented on code in PR #6457:
URL: https://github.com/apache/rocketmq/pull/6457#discussion_r1147067386


##########
client/src/main/java/org/apache/rocketmq/client/impl/consumer/ConsumeMessageConcurrentlyService.java:
##########
@@ -105,9 +105,11 @@ public void shutdown(long awaitTerminateMillis) {
 
     @Override
     public void updateCorePoolSize(int corePoolSize) {
-        if (corePoolSize > 0
-            && corePoolSize <= Short.MAX_VALUE
-            && corePoolSize < this.defaultMQPushConsumer.getConsumeThreadMax()) {
+        if (corePoolSize > 0 && corePoolSize != this.consumeExecutor.getCorePoolSize()
+                && corePoolSize <= Short.MAX_VALUE) {
+            if (corePoolSize > this.consumeExecutor.getMaximumPoolSize()) {
+                this.consumeExecutor.setMaximumPoolSize(corePoolSize);
+            }

Review Comment:
   Do you mean if input corePoolSize > this.consumeExecutor.getMaximumPoolSize() then return , not to update maximumPoolSize?



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

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


Re: [PR] [ISSUE #6456] Fix ConsumeMessageService#updateCorePoolSize: Can not i… [rocketmq]

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

   This PR is stale because it has been open for 365 days with no activity. It will be closed in 3 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this PR.


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

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