XnLemon commented on code in PR #3395:
URL: https://github.com/apache/dubbo-go/pull/3395#discussion_r3401442096
##########
registry/servicediscovery/service_instances_changed_listener_impl.go:
##########
@@ -258,20 +263,61 @@ func GetMetadataInfo(app string, instance
registry.ServiceInstance, revision str
var metadataInfo *info.MetadataInfo
var err error
if instance.GetMetadata() == nil {
+ // No metadata map at all; treat as default (local/RPC) storage
type.
metadataStorageType = constant.DefaultMetadataStorageType
} else {
metadataStorageType =
instance.GetMetadata()[constant.MetadataStorageTypePropertyName]
+ if metadataStorageType == "" {
+ // MetadataStorageTypePropertyName absent (e.g. old
Java provider); default to local storage type.
+ logger.Warnf("[Metadata] MetadataStorageType not set
for instance %s, defaulting to local", instance.GetID())
+ metadataStorageType =
constant.DefaultMetadataStorageType
+ }
}
+
if metadataStorageType == constant.RemoteMetadataStorageType {
- metadataInfo, err =
metadata.GetMetadataFromMetadataReport(revision, instance, registryId)
- if err != nil {
- return nil, err
+ var reportErr error
+ metadataInfo, reportErr =
metadata.GetMetadataFromMetadataReport(revision, instance, registryId)
Review Comment:
applied
--
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]