You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@eventmesh.apache.org by "willimpo (via GitHub)" <gi...@apache.org> on 2023/04/12 15:22:02 UTC

[GitHub] [eventmesh] willimpo opened a new pull request, #3708: [ISSUE #3707]fix thread leak with rocketmq consumer start and shutdown frequently

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

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


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


[GitHub] [eventmesh] codecov[bot] commented on pull request #3708: [ISSUE #3707]fix thread leak with rocketmq consumer start and shutdown frequently

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #3708:
URL: https://github.com/apache/eventmesh/pull/3708#issuecomment-1506445119

   ## [Codecov](https://codecov.io/gh/apache/eventmesh/pull/3708?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 [#3708](https://codecov.io/gh/apache/eventmesh/pull/3708?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (0e1fc5a) into [master](https://codecov.io/gh/apache/eventmesh/commit/36036dac908e35df76bd2e899cc44bee0be4640a?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (36036da) will **decrease** coverage by `0.02%`.
   > The diff coverage is `0.00%`.
   
   > :exclamation: Current head 0e1fc5a differs from pull request most recent head 508579b. Consider uploading reports for the commit 508579b to get more accurate results
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #3708      +/-   ##
   ============================================
   - Coverage     13.76%   13.75%   -0.02%     
     Complexity     1291     1291              
   ============================================
     Files           571      571              
     Lines         29239    29235       -4     
     Branches       2884     2872      -12     
   ============================================
   - Hits           4024     4020       -4     
   - Misses        24841    24842       +1     
   + Partials        374      373       -1     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/eventmesh/pull/3708?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/eventmesh/pull/3708?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXN0b3JhZ2UtcGx1Z2luL2V2ZW50bWVzaC1zdG9yYWdlLXJvY2tldG1xL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9jbGllbnQvaW1wbC9jb25zdW1lci9Db25zdW1lTWVzc2FnZUNvbmN1cnJlbnRseVNlcnZpY2UuamF2YQ==) | `0.00% <0.00%> (ø)` | |
   
   ... and [7 files with indirect coverage changes](https://codecov.io/gh/apache/eventmesh/pull/3708/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: issues-unsubscribe@eventmesh.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: issues-help@eventmesh.apache.org


[GitHub] [eventmesh] xwm1992 merged pull request #3708: [ISSUE #3707]fix thread leak with rocketmq consumer start and shutdown frequently

Posted by "xwm1992 (via GitHub)" <gi...@apache.org>.
xwm1992 merged PR #3708:
URL: https://github.com/apache/eventmesh/pull/3708


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

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


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


[GitHub] [eventmesh] willimpo commented on pull request #3708: [ISSUE #3707]fix thread leak with rocketmq consumer start and shutdown frequently

Posted by "willimpo (via GitHub)" <gi...@apache.org>.
willimpo commented on PR #3708:
URL: https://github.com/apache/eventmesh/pull/3708#issuecomment-1506682727

   @xwm1992 pls make a review,thx


-- 
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: issues-unsubscribe@eventmesh.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: issues-help@eventmesh.apache.org