Skip to content
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

fix: when the routing policy is not set, the setInvokers() method has a co process leak #2104

Merged
merged 10 commits into from
Nov 26, 2022
Merged
Next Next commit
非路由策略下,不触发节点变更的数据变更协程消息
  • Loading branch information
caochengxiang committed Nov 4, 2022
commit 915f117ad6f134e1fc97387a2a5821f9f7ef842c
7 changes: 7 additions & 0 deletions cluster/router/chain/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ func (c *RouterChain) AddRouters(routers []router.PriorityRouter) {
c.mutex.Lock()
defer c.mutex.Unlock()
c.routers = newRouters
if len(extension.GetRouterFactories()) == 0 {
return
}

go func() {
c.notify <- struct{}{}
}()
Expand All @@ -124,6 +128,9 @@ func (c *RouterChain) SetInvokers(invokers []protocol.Invoker) {
c.mutex.Lock()
c.invokers = invokers
c.mutex.Unlock()
if len(extension.GetRouterFactories()) == 0 {
return
}

go func() {
c.notify <- struct{}{}
Expand Down