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/04 02:30:51 UTC

[GitHub] [rocketmq-client-go] always-waiting opened a new issue #741: BUG for shutdown?

always-waiting opened a new issue #741:
URL: https://github.com/apache/rocketmq-client-go/issues/741


   ![image](https://user-images.githubusercontent.com/8566918/140247234-072a9356-7196-4905-8c69-a1b9e0624307.png)
   
   when i used PushConsumer.Shutdown to close, there were some gorountine left. I thought there was a bug for close.
   
   the problem is here: 
   https://github.com/apache/rocketmq-client-go/blob/673760e6a33cd48fd7266efe6a4fb47b7138f211/consumer/push_consumer.go#L961
   
   the getMessage hange although consumer had shutdown


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



[GitHub] [rocketmq-client-go] always-waiting commented on issue #741: BUG for shutdown?

Posted by GitBox <gi...@apache.org>.
always-waiting commented on issue #741:
URL: https://github.com/apache/rocketmq-client-go/issues/741#issuecomment-961558691






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



[GitHub] [rocketmq-client-go] always-waiting commented on issue #741: BUG for shutdown?

Posted by GitBox <gi...@apache.org>.
always-waiting commented on issue #741:
URL: https://github.com/apache/rocketmq-client-go/issues/741#issuecomment-960390802


   @180909 帮忙确认一下,这个是否为一个bug?


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



[GitHub] [rocketmq-client-go] maixiaohai commented on issue #741: BUG for shutdown?

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


   https://github.com/apache/rocketmq-client-go/issues/614
   same issue? Try related patch


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



[GitHub] [rocketmq-client-go] always-waiting commented on issue #741: BUG for shutdown?

Posted by GitBox <gi...@apache.org>.
always-waiting commented on issue #741:
URL: https://github.com/apache/rocketmq-client-go/issues/741#issuecomment-961558691






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



[GitHub] [rocketmq-client-go] tt-live commented on issue #741: BUG for shutdown?

Posted by GitBox <gi...@apache.org>.
tt-live commented on issue #741:
URL: https://github.com/apache/rocketmq-client-go/issues/741#issuecomment-985186805


   @wenfengwang 大佬,帮忙看看这个chan是否需要在dorebalance里面更新队列信息,删除队列的时候,同时关闭chan
   ```
   func (pq *processQueue) WithDropped(dropped bool) {
   	if dropped {
   		close(pq.msgCh)
   	}
   	pq.dropped.Store(dropped)
   }
   ```
   
   
   正常的应该是在队列删除的时候,就把这个chan关闭,不然会一直产生goroutine泄露的问题,另外我看了master分支的代码,在服务shutdown的时候,会关闭chan,那个地方的逻辑应该删除掉,不然服务重启的或者关闭的时候会引发panic,删除一个已经关闭的chan
   
   ```
   func (dc *defaultConsumer) shutdown() error {
   	atomic.StoreInt32(&dc.state, int32(internal.StateShutdown))
   
   	mqs := make([]*primitive.MessageQueue, 0)
   	dc.processQueueTable.Range(func(key, value interface{}) bool {
   		k := key.(primitive.MessageQueue)
   		pq := value.(*processQueue)
   		pq.WithDropped(true)
   		// close msg channel using RWMutex to make sure no data was writing
   		pq.mutex.Lock()
   		**// close(pq.msgCh) 这段代码应该删除掉**
   		pq.mutex.Unlock()
   		mqs = append(mqs, &k)
   		return true
   	})
   	dc.stat.ShutDownStat()
   	dc.storage.persist(mqs)
   	dc.client.Shutdown()
   	return nil
   }
   ```


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



[GitHub] [rocketmq-client-go] always-waiting commented on issue #741: BUG for shutdown?

Posted by GitBox <gi...@apache.org>.
always-waiting commented on issue #741:
URL: https://github.com/apache/rocketmq-client-go/issues/741#issuecomment-961558691


   @180909 我看了源码,判断是https://github.com/apache/rocketmq-client-go/blob/673760e6a33cd48fd7266efe6a4fb47b7138f211/consumer/push_consumer.go#L961 这里获取数据的时候,在一直等待channel返回数据,所以goroutine不会停止。因该需要在某个地方,有一个close那个channel的地方。
   
   但是有一个问题是,往已经关闭的channel里放数据,会引发panic,所以具体在哪里关闭这个channel,我无法确定。这个还需要更熟悉代码的朋友帮忙。
   
   能否帮忙解决这个bug?


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



[GitHub] [rocketmq-client-go] always-waiting commented on issue #741: BUG for shutdown?

Posted by GitBox <gi...@apache.org>.
always-waiting commented on issue #741:
URL: https://github.com/apache/rocketmq-client-go/issues/741#issuecomment-961780652


   @maixiaohai 我使用的是v2.1.0版本,是否因为版本过低了?


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



[GitHub] [rocketmq-client-go] maixiaohai commented on issue #741: BUG for shutdown?

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


   https://github.com/apache/rocketmq-client-go/issues/614
   same issue? Try related patch


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



[GitHub] [rocketmq-client-go] maixiaohai commented on issue #741: BUG for shutdown?

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


   https://github.com/apache/rocketmq-client-go/issues/614
   same issue? Try related patch


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



[GitHub] [rocketmq-client-go] 180909 commented on issue #741: BUG for shutdown?

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


   > @180909 帮忙确认一下,这个是否为一个bug?
   
   简单看了下,确实在很短的时间内,goroutine数量一直在增加。


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