You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2021/11/16 05:48:06 UTC

[GitHub] [rocketmq] XiaoyiPeng opened a new issue #3493: DefaultMQPushConsumer#setConsumeThreadMax(int consumeThreadMax) has no effect.

XiaoyiPeng opened a new issue #3493:
URL: https://github.com/apache/rocketmq/issues/3493


   **BUG REPORT**
   
   1. Please describe the issue you observed:
   
   
   
       a):  `DefaultMQPushConsumer#setConsumeThreadMax(int consumeThreadMax)` has no effect.
   
        b): Potential memory exhaustion risk
   
        When program creating the thread pool `ConsumeMessageConcurrentlyService#consumeExecutor`, a blocking queue with no length limit was used, as shown below : 
   ```
   public ConsumeMessageConcurrentlyService(DefaultMQPushConsumerImpl defaultMQPushConsumerImpl,
           MessageListenerConcurrently messageListener) {
           \\...
           this.consumeRequestQueue = new LinkedBlockingQueue<Runnable>();
   
           this.consumeExecutor = new ThreadPoolExecutor(
               this.defaultMQPushConsumer.getConsumeThreadMin(),
               this.defaultMQPushConsumer.getConsumeThreadMax(),
               1000 * 60,
               TimeUnit.MILLISECONDS,
               this.consumeRequestQueue,
               new ThreadFactoryImpl("ConsumeMessageThread_")); 
           \\...
   }
   ```
   This will probably lead to : 
           a):  a potential risk of running out of memory, 
           b):  `DefaultMQPushConsumer#setConsumeThreadMax(int consumeThreadMax) ` has no effect.
   
   2. Please tell us about your environment:
   Windows10


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

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