Alanxtl commented on code in PR #3372:
URL: https://github.com/apache/dubbo-go/pull/3372#discussion_r3368854903
##########
registry/protocol/protocol.go:
##########
@@ -296,49 +381,41 @@ func registerServiceMap(invoker base.Invoker) error {
// such as
dubbo://:20000/org.apache.dubbo.UserProvider?bean.name=UserProvider&cluster=failfast...
id := providerUrl.GetParam(constant.BeanNameKey, "")
- // TODO: Temporary compatibility with old APIs, can be removed later
-
- providerConfig := config.GetProviderConfig()
+ providerConfRaw, ok :=
providerUrl.GetAttribute(constant.ProviderConfigKey)
+ if !ok {
+ return perrors.Errorf("reExport can not get provider config
from url attribute %s", constant.ProviderConfigKey)
+ }
+ providerConf, ok := providerConfRaw.(*global.ProviderConfig)
+ if !ok || providerConf == nil {
+ return perrors.Errorf("reExport got illegal provider config
from url attribute %s", constant.ProviderConfigKey)
+ }
Review Comment:
here now makes `reExport` depend entirely on `ProviderConfigKey` being
present in the provider URL. The new `server/action.go` path sets it, but the
still-existing legacy `config.ServiceConfig` export path does not set
`ProviderConfigKey`; it only builds params and conditionally sets
`RpcServiceKey`. Since #3329 is explicitly staged and the legacy bridge is not
removed until later PRs, dynamic override on old config exports can now fail to
restore `ServiceMap` after `oldExporter.UnExport()`, then continue re-exporting
with the service map missing. Either inject `ProviderConfigKey` in the legacy
export path in this PR, or keep a compatibility fallback until the later
bridge-removal PR.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]