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

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

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