You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2022/11/01 04:35:03 UTC

[GitHub] [dubbo-go] caochengxiang opened a new issue, #2101: 1.5.7版本,协程泄漏

caochengxiang opened a new issue, #2101:
URL: https://github.com/apache/dubbo-go/issues/2101

   1、线上协程泄漏,通过pprof发现下面两处会有协程泄漏,cluster/router/chain/chain.go;
   func (c *RouterChain) AddRouters(routers []router.PriorityRouter) {
   	newRouters := make([]router.PriorityRouter, 0, len(c.builtinRouters)+len(routers))
   	newRouters = append(newRouters, c.builtinRouters...)
   	newRouters = append(newRouters, routers...)
   	sortRouter(newRouters)
   	c.mutex.Lock()
   	defer c.mutex.Unlock()
   	c.routers = newRouters
   	go func() {
   		c.notify <- struct{}{}
   	}()
   }
   
   // SetInvokers receives updated invokers from registry center. If the times of notification exceeds countThreshold and
   // time interval exceeds timeThreshold since last cache update, then notify to update the cache.
   func (c *RouterChain) SetInvokers(invokers []protocol.Invoker) {
   	c.mutex.Lock()
   	c.invokers = invokers
   	c.mutex.Unlock()
   
   	go func() {
   		c.notify <- struct{}{}
   	}()
   }
   
   2、加_ "git.n.xiaomi.com/open-lib/dubbo-go/cluster/router/conncheck",上述泄漏问题解决,但是会出现新的问题,pprof显示在下面c.mutex.RLock()产生大量协程,这就麻烦了
   
   func (c *RouterChain) copyRouters() []router.PriorityRouter {
   	c.mutex.RLock()
   	defer c.mutex.RUnlock()
   	ret := make([]router.PriorityRouter, 0, len(c.routers))
   	ret = append(ret, c.routers...)
   	return ret
   }


-- 
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: notifications-unsubscribe@dubbo.apache.org.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go] AlexStocks closed issue #2101: 1.5.7版本,协程泄漏

Posted by GitBox <gi...@apache.org>.
AlexStocks closed issue #2101: 1.5.7版本,协程泄漏
URL: https://github.com/apache/dubbo-go/issues/2101


-- 
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: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo-go] AlexStocks commented on issue #2101: 1.5.7版本,协程泄漏

Posted by GitBox <gi...@apache.org>.
AlexStocks commented on issue #2101:
URL: https://github.com/apache/dubbo-go/issues/2101#issuecomment-1298055252

   来钉钉群 23331795,进来后报上这个 issue,一块聊下。


-- 
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: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org