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 2020/09/07 11:30:03 UTC

[GitHub] [dubbo-go] beiwei30 opened a new issue #743: dynamic router is constructed each time when address is notified

beiwei30 opened a new issue #743:
URL: https://github.com/apache/dubbo-go/issues/743


   <!-- Please use this template while reporting a bug and provide as much info as possible. Not doing so may result in your bug not being addressed in a timely manner. Thanks!
   
   -->
   
   
   **What happened**:
   
   dynamic router is constructed each time when address is notified, which should only happen when the notified address is 'router://' url.
   
   ```golang
   	if res != nil {
   		url = &res.Service
   		// 1.for override url in 2.6.x
   		if url.Protocol == constant.OVERRIDE_PROTOCOL ||
   			url.GetParam(constant.CATEGORY_KEY, constant.DEFAULT_CATEGORY) == constant.CONFIGURATORS_CATEGORY {
   			dir.configurators = append(dir.configurators, extension.GetDefaultConfigurator(url))
   			url = nil
   		} else if url.Protocol == constant.ROUTER_PROTOCOL || // 2.for router
   			url.GetParam(constant.CATEGORY_KEY, constant.DEFAULT_CATEGORY) == constant.ROUTER_CATEGORY {
   			url = nil
   
   		}
   		switch res.Action {
   		case remoting.EventTypeAdd, remoting.EventTypeUpdate:
   			logger.Infof("selector add service url{%s}", res.Service)
   
   			var urls []*common.URL
   			for _, v := range config.GetRouterURLSet().Values() {
   				urls = append(urls, v.(*common.URL))
   			}
   
   			if len(urls) > 0 {
   				dir.SetRouters(urls) // <-- I don't think this is correct.
   			}
   			oldInvoker = dir.cacheInvoker(url)
   		case remoting.EventTypeDel:
   			oldInvoker = dir.uncacheInvoker(url)
   			logger.Infof("selector delete service url{%s}", res.Service)
   		default:
   			return
   		}
   	}
   ```
   
   **What you expected to happen**:
   
   **How to reproduce it (as minimally and precisely as possible)**:
   
   **Anything else we need to know?**:
   


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



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


[GitHub] [dubbo-go] cityiron closed issue #743: dynamic router is constructed each time when address is notified

Posted by GitBox <gi...@apache.org>.
cityiron closed issue #743:
URL: https://github.com/apache/dubbo-go/issues/743


   


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



---------------------------------------------------------------------
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 #743: dynamic router is constructed each time when address is notified

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


   cc [venusDo](https://github.com/venusDo)


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



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