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:27:29 UTC
[GitHub] [dubbo-go] beiwei30 opened a new issue #742: l.directory.refreshInvokers(nil) will not trigger dir.overrideUrl(newUrl)
beiwei30 opened a new issue #742:
URL: https://github.com/apache/dubbo-go/issues/742
<!-- 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**:
In directory.go, l.directory.refreshInvokers(nil) should trigger dir's overrideUrl(), if you look into Java's implementation. Since nil is passed into diredtory.refreshInvokers(), and dir's overrideUrl() is called by cacheInvoker(), but it will not be possible when refreshInvokers's parameter is nil.
See this:
```golang
if res != nil { // <- res is 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)
}
oldInvoker = dir.cacheInvoker(url) // <- override happens here.
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] AlexStocks closed issue #742: l.directory.refreshInvokers(nil) will not trigger dir.overrideUrl(newUrl)
Posted by GitBox <gi...@apache.org>.
AlexStocks closed issue #742:
URL: https://github.com/apache/dubbo-go/issues/742
--
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