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/01/04 06:34:53 UTC

[GitHub] [rocketmq-client-go] NAND86 opened a new issue #580: [Master] consumeMessageOrderly goroutine leaks

NAND86 opened a new issue #580:
URL: https://github.com/apache/rocketmq-client-go/issues/580


   **BUG REPORT**  
   **Please add the branch name [Native]/[Master] at the header of the Isssue title.**
   
   1. Please describe the issue you observed:
   
   顺序消费者订阅了一个暂时没有生产者生产消息的topic。72小时后协程数量从945增长到18445多,绝大部分协程的堆栈都在takeMessages(func (pq *processQueue)takeMessages(number int) []*primitive.MessageExt{})
   
   2. Please tell us about your environment:
   
        - What is your OS? linux
        - What is your client version? v2.0.0
        - What is your RocketMQ version? v4.3.2
   
   3. Other information (e.g. detailed explanation, logs, related issues, suggestions on how to fix, etc):
   
   怀疑点:
   每次从pc.prCh中取出pr,开启协程 pullMessage。
   pullMessage 内部开启协程 submitToConsumer,对于顺序消费者就是 consumeMessageOrderly 。
   consumeMessageOrderly 内部 takeMessages,如果msgCache一直为空,就会一直卡在for循环中,协程不会退出。
   
   我不能理解的是,只有每次balance时新增了queue,才会 prCh<-pr,才会出现上面协程泄露的流程。
   为什么会一直balance新增queue呢,并没有出现client反复上下线情况啊,是我流程理解有误么。
   


----------------------------------------------------------------
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.

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



[GitHub] [rocketmq-client-go] ShannonDing closed issue #580: [Master] consumeMessageOrderly goroutine leaks

Posted by GitBox <gi...@apache.org>.
ShannonDing closed issue #580:
URL: https://github.com/apache/rocketmq-client-go/issues/580


   


----------------------------------------------------------------
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.

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



[GitHub] [rocketmq-client-go] NAND86 commented on issue #580: [Master] consumeMessageOrderly goroutine leaks

Posted by GitBox <gi...@apache.org>.
NAND86 commented on issue #580:
URL: https://github.com/apache/rocketmq-client-go/issues/580#issuecomment-755042659


   原因已经在 #587 说明清楚。
   这个问题主要是异常测试中同一消费者组内的顺序消费者频繁启停,导致一直存活的客户端一直新增队列删除队列。协程一直泄露,但是topic又一直没消息,所有协程都卡在consumeMessageOrderly 内部 takeMessages的for循环中。
   
   所以如果takeMessages的for循环一段时间拿不到消息最好退出循环吧,否则解决了协程泄露的问题,仍然会有一个协程卡在for中。


----------------------------------------------------------------
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.

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