-
Notifications
You must be signed in to change notification settings - Fork 423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUG for shutdown? #741
Comments
@180909 帮忙确认一下,这个是否为一个bug? |
简单看了下,确实在很短的时间内,goroutine数量一直在增加。 |
@180909 我看了源码,判断是 rocketmq-client-go/consumer/push_consumer.go Line 961 in 673760e
但是有一个问题是,往已经关闭的channel里放数据,会引发panic,所以具体在哪里关闭这个channel,我无法确定。这个还需要更熟悉代码的朋友帮忙。 能否帮忙解决这个bug? |
#614 |
@maixiaohai 我使用的是v2.1.0版本,是否因为版本过低了? |
@wenfengwang 大佬,帮忙看看这个chan是否需要在dorebalance里面更新队列信息,删除队列的时候,同时关闭chan
正常的应该是在队列删除的时候,就把这个chan关闭,不然会一直产生goroutine泄露的问题,另外我看了master分支的代码,在服务shutdown的时候,会关闭chan,那个地方的逻辑应该删除掉,不然服务重启的或者关闭的时候会引发panic,删除一个已经关闭的chan
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 14 days if no further activity occurs. Thank you for your contributions. |
当在一个循环里不断的新建PushConsumer,并Start和Shutdown时,发现协程在不断的增长。查看了源码,感觉有一个Shutdown的bug。具体问题如下:
rocketmq-client-go/consumer/push_consumer.go
Line 961 in 673760e
虽然Shutdown了PushConsumer但是getMessage函数在等待一个channel的返回值,因此挂起了。
如下是一个测试用例,Shutdown后,发现有些goroute没有关闭,结果如上面的图片
The text was updated successfully, but these errors were encountered: