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 2021/04/11 08:14:20 UTC

[GitHub] [dubbo-go] ztelur commented on a change in pull request #1135: fix reExporter bug when config-center {applicationName}.configurator data change

ztelur commented on a change in pull request #1135:
URL: https://github.com/apache/dubbo-go/pull/1135#discussion_r611150074



##########
File path: registry/protocol/protocol.go
##########
@@ -221,17 +223,47 @@ func (proto *registryProtocol) Export(invoker protocol.Invoker) protocol.Exporte
 }
 
 func (proto *registryProtocol) reExport(invoker protocol.Invoker, newUrl *common.URL) {
-	url := getProviderUrl(invoker)
-	key := getCacheKey(url)
+	key := getCacheKey(invoker)
 	if oldExporter, loaded := proto.bounds.Load(key); loaded {
 		wrappedNewInvoker := newWrappedInvoker(invoker, newUrl)
 		oldExporter.(protocol.Exporter).Unexport()
 		proto.bounds.Delete(key)
+
+		// oldExporter Unexport function unRegister rpcService from the serviceMap, so need register it again as far as possible
+		if err := registerServiceMap(invoker); err != nil {

Review comment:
       在初始化时,service_config.Export会进行registerServiceMap,如果再放在proto.Export 中,就会注册两次,所以那个方案改动会很多。这次修改是尽量争取影响范围最小的修改。




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