willimpo opened a new pull request, #3708:
URL: https://github.com/apache/eventmesh/pull/3708

   <!--
   ### Contribution Checklist
   
     - Name the pull request in the form "[ISSUE #XXXX] Title of the pull 
request", 
       where *XXXX* should be replaced by the actual issue number.
       Skip *[ISSUE #XXXX]* if there is no associated github issue for this 
pull request.
   
     - Fill out the template below to describe the changes contributed by the 
pull request. 
       That will give reviewers the context they need to do the review.
     
     - Each pull request should address only one issue. 
       Please do not mix up code from multiple issues.
     
     - Each commit in the pull request should have a meaningful commit message.
   
     - Once all items of the checklist are addressed, remove the above text and 
this checklist, 
       leaving only the filled out template below.
   
   (The sections below can be removed for hotfixes of typos)
   -->
   
   <!--
   (If this PR fixes a GitHub issue, please add `Fixes #<XXX>` or `Closes 
#<XXX>`.)
   -->
   
   Fixes #<3707>.
   
   ### Motivation
   when using rocketmq as eventmesh storage,and consumer groups are frequently 
started and shutdown.
   
   The number of threads in the process continues to increase,and eventually 
led to Full GC
   
   
   
   
   ### Modifications
   
   In the rocketmq eventmesh storage, we overwrite the 
ConsumeMessageConcurrentlyService.java of rocketmq 
   but in the shutdown(long) method, we didn't do anything, this led to some 
consumer threads are not recycled when consumer was shutdown
   
   **the shutdown(long) method in ConsumeMessageConcurrentlyService.java**
   ```
       public void shutdown(long awaitTerminateMillis) {
   
       }
   ```
   
   **where the ConsumeMessageConcurrentlyService.shutdown(long) method was 
invoked**
   ```
   DefaultMQPushConsumerImpl.java:
   
       public synchronized void shutdown(long awaitTerminateMillis) {
           switch (this.serviceState) {
               case CREATE_JUST:
                   break;
               case RUNNING:
                   // here invokes the shutdown method
                   this.consumeMessageService.shutdown(awaitTerminateMillis);
                   this.persistConsumerOffset();
                   
this.mQClientFactory.unregisterConsumer(this.defaultMQPushConsumer.getConsumerGroup());
                   this.mQClientFactory.shutdown();
                   log.info("the consumer [{}] shutdown OK", 
this.defaultMQPushConsumer.getConsumerGroup());
                   this.rebalanceImpl.destroy();
                   this.serviceState = ServiceState.SHUTDOWN_ALREADY;
                   break;
               case SHUTDOWN_ALREADY:
                   break;
               default:
                   break;
           }
       }
   ```
   
   Therefore, my modification is to supplement the logic of shutdown (long) .
   
   
   
   ### Documentation
   
   - Does this pull request introduce a new feature? (yes / no)
   - If yes, how is the feature documented? (not applicable / docs / JavaDocs / 
not documented)
   - If a feature is not applicable for documentation, explain why?
   - If a feature is not documented yet in this PR, please create a followup 
issue for adding the documentation
   


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

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@eventmesh.apache.org
For additional commands, e-mail: dev-h...@eventmesh.apache.org

Reply via email to