AlexStocks commented on code in PR #3605:
URL: https://github.com/apache/dubbo-go/pull/3605#discussion_r3764623309
##########
metadata/mapping/metadata/service_name_mapping.go:
##########
@@ -71,20 +74,34 @@ type ServiceNameMapping struct {
}
// Map will map the service to this application-level service
-func (d *ServiceNameMapping) Map(url *common.URL) error {
+func (d *ServiceNameMapping) Map(url *common.URL) (err error) {
serviceInterface := url.GetParam(constant.InterfaceKey, "")
appName := url.GetParam(constant.ApplicationKey, "")
// url is the service url,not the registry url,this url has no registry
id info,can not get where to write mapping,so write all
// if the mapping can hold a report instance, it can write once
metadataReports := metadata.GetMetadataReports()
if len(metadataReports) == 0 {
- return perrors.New("can not registering mapping to remote cause
no metadata report instance found")
+ err = perrors.New("can not registering mapping to remote cause
no metadata report instance found")
Review Comment:
[P1] 这里在创建 mapping metric event 之前就返回了,因此“未配置 metadata
report”这一真实失败路径不会发布失败指标;`Get` 和 `Remove` 也有相同问题。当前 Head 的外部探针依次调用
`Map/Get/Remove`,三个调用都返回错误,但订阅端一个 mapping event 都收不到。请在检查 report 列表之前初始化并 defer
发布事件,确保这些 early return 也带上操作类型、标签、`Succ=false` 和结束时间,并补无 report 的生产入口回归测试。
--
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]