Re: [PR] feat(metadata): strengthen service-app mapping consistency, retry and… [dubbo-go]

2026-06-09 Thread via GitHub


Copilot commented on code in PR #3373:
URL: https://github.com/apache/dubbo-go/pull/3373#discussion_r3384856782


##
metadata/mapping/metadata/service_name_mapping_concurrency_test.go:
##
@@ -0,0 +1,223 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package metadata
+
+import (
+   "fmt"
+   "sync"
+   "testing"
+)

Review Comment:
   The reader goroutine loops in a tight `select { default: ... }` without 
yielding, which can busy-spin and significantly increase CPU usage (and 
runtime) under `-race`. Import `runtime` so the loop can yield with 
`runtime.Gosched()` (see next change).



##
metadata/mapping/metadata/service_name_mapping.go:
##
@@ -73,19 +81,41 @@ func (d *ServiceNameMapping) Map(url *common.URL) error {
return perrors.New("can not registering mapping to remote cause 
no metadata report instance found")
}
for _, metadataReport := range metadataReports {
-   var err error
-   for i := 0; i < retryTimes; i++ {
-   if err = 
metadataReport.RegisterServiceAppMapping(serviceInterface, DefaultGroup, 
appName); err == nil {
-   break
-   }
-   }
-   if err != nil {
+   if err := registerWithRetry(metadataReport, serviceInterface, 
DefaultGroup, appName); err != nil {

Review Comment:
   Map() can proceed with an empty interface or application name (both default 
to "" when missing in URL params). That would register a mapping under an 
invalid key and/or write an empty app element, potentially corrupting 
service-app mapping data. Add a guard to fail fast when required params are 
missing.



##
metadata/mapping/metadata/service_name_mapping_concurrency_test.go:
##
@@ -0,0 +1,223 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package metadata
+
+import (
+   "fmt"
+   "sync"
+   "testing"
+)
+
+import (
+   gxset "github.com/dubbogo/gost/container/set"
+
+   "github.com/stretchr/testify/assert"
+)
+
+import (
+   "dubbo.apache.org/dubbo-go/v3/metadata/info"
+   "dubbo.apache.org/dubbo-go/v3/metadata/mapping"
+   "dubbo.apache.org/dubbo-go/v3/metadata/report"
+)
+
+// versionedStore is an in-memory key/value store with a per-key version, 
modeling the
+// compare-and-swap primitive a real metadata center (etcd ModRevision, zk 
Stat.Version,
+// nacos content MD5) provides.
+type versionedStore struct {
+   mu   sync.Mutex
+   data map[string]versionedEntry
+}
+
+type versionedEntry struct {
+   val string
+   ver int64
+}
+
+func newVersionedStore() *versionedStore {
+   return &versionedStore{data: make(map[string]versionedEntry)}
+}
+
+func (s *versionedStore) get(key string) (string, int64) {
+   s.mu.Lock()
+   defer s.mu.Unlock()
+   e := s.data[key]
+   return e.val, e.ver
+}
+
+// cas writes val only if the current version equals ver, returning whether it 
was applied.
+func (s *versionedStore) cas(key, val string, ver int64) bool {
+   s.mu.Lock()
+   defer s.mu.Unlock()
+   if s.data[key].ver != ver {
+   return false
+   }
+   s.data[key] = versionedEntry{val: val, ver: ver + 1}
+   return true
+}
+
+// put writes unconditionally, modeling the old read-modify-write behavior 
without CAS.
+func (s *versionedStore) put(key, val string) {
+   

Re: [PR] feat(metadata): strengthen service-app mapping consistency, retry and… [dubbo-go]

2026-06-09 Thread via GitHub


AlexStocks merged PR #3373:
URL: https://github.com/apache/dubbo-go/pull/3373


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



Re: [PR] feat(metadata): strengthen service-app mapping consistency, retry and… [dubbo-go]

2026-06-08 Thread via GitHub


Alanxtl commented on PR #3373:
URL: https://github.com/apache/dubbo-go/pull/3373#issuecomment-4655870115

   这个 PR 和 #3371 同时改 metadata/report/nacos、etcd、zookeeper,最终合入前一定要 rebase 到最新 
develop,确认 MetadataReport 新接口和 mapping CAS 改动都还在。


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



Re: [PR] feat(metadata): strengthen service-app mapping consistency, retry and… [dubbo-go]

2026-06-08 Thread via GitHub


codecov-commenter commented on PR #3373:
URL: https://github.com/apache/dubbo-go/pull/3373#issuecomment-4649711869

   ## 
[Codecov](https://app.codecov.io/gh/apache/dubbo-go/pull/3373?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 Report
   :x: Patch coverage is `47.05882%` with `45 lines` in your changes missing 
coverage. Please review.
   :white_check_mark: Project coverage is 52.55%. Comparing base 
([`60d1c2a`](https://app.codecov.io/gh/apache/dubbo-go/commit/60d1c2a949f0ee0da4be3fe09fb79d295491e040?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache))
 to head 
([`7d6dbf5`](https://app.codecov.io/gh/apache/dubbo-go/commit/7d6dbf55e2cbcd76f1f530f42d41eafdf7585a0b?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 818 commits behind head on develop.
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/dubbo-go/pull/3373?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | Patch % | Lines |
   |---|---|---|
   | 
[metadata/report/etcd/report.go](https://app.codecov.io/gh/apache/dubbo-go/pull/3373?src=pr&el=tree&filepath=metadata%2Freport%2Fetcd%2Freport.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-bWV0YWRhdGEvcmVwb3J0L2V0Y2QvcmVwb3J0Lmdv)
 | 0.00% | [17 Missing :warning: 
](https://app.codecov.io/gh/apache/dubbo-go/pull/3373?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 |
   | 
[metadata/report/nacos/report.go](https://app.codecov.io/gh/apache/dubbo-go/pull/3373?src=pr&el=tree&filepath=metadata%2Freport%2Fnacos%2Freport.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-bWV0YWRhdGEvcmVwb3J0L25hY29zL3JlcG9ydC5nbw==)
 | 21.05% | [14 Missing and 1 partial :warning: 
](https://app.codecov.io/gh/apache/dubbo-go/pull/3373?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 |
   | 
[metadata/report/zookeeper/report.go](https://app.codecov.io/gh/apache/dubbo-go/pull/3373?src=pr&el=tree&filepath=metadata%2Freport%2Fzookeeper%2Freport.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-bWV0YWRhdGEvcmVwb3J0L3pvb2tlZXBlci9yZXBvcnQuZ28=)
 | 13.33% | [13 Missing :warning: 
](https://app.codecov.io/gh/apache/dubbo-go/pull/3373?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 |
   
   Additional details and impacted files
   
   
   
   ```diff
   @@ Coverage Diff @@
   ##   develop#3373  +/-   ##
   ===
   + Coverage46.76%   52.55%   +5.78% 
   ===
 Files  295  493 +198 
 Lines1717237908   +20736 
   ===
   + Hits  803119922   +11891 
   - Misses828716379+8092 
   - Partials   854 1607 +753 
   ```
   
   
   [:umbrella: View full report in Codecov by 
Harness](https://app.codecov.io/gh/apache/dubbo-go/pull/3373?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   
   :loudspeaker: Have feedback on the report? [Share it 
here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:rocket: New features to boost your workflow: 
   
   - :snowflake: [Test 
Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, 
report on failures, and find test suite problems.
   


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



Re: [PR] feat(metadata): strengthen service-app mapping consistency, retry and… [dubbo-go]

2026-06-08 Thread via GitHub


sonarqubecloud[bot] commented on PR #3373:
URL: https://github.com/apache/dubbo-go/pull/3373#issuecomment-4649388156

   ## [![Quality Gate 
Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png
 'Quality Gate 
Passed')](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3373) 
**Quality Gate passed**  
   Issues  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png
 '') [0 New 
issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3373&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png
 '') [0 Accepted 
issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3373&issueStatuses=ACCEPTED)
   
   Measures  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png
 '') [0 Security 
Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3373&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png
 '') [0.0% Coverage on New 
Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3373&metric=new_coverage&view=list)
  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png
 '') [0.0% Duplication on New 
Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3373&metric=new_duplicated_lines_density&view=list)
  
 
   
   [See analysis details on SonarQube 
Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3373)
   
   


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



Re: [PR] feat(metadata): strengthen service-app mapping consistency, retry and… [dubbo-go]

2026-06-08 Thread via GitHub


sonarqubecloud[bot] commented on PR #3373:
URL: https://github.com/apache/dubbo-go/pull/3373#issuecomment-4649229056

   ## [![Quality Gate 
Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png
 'Quality Gate 
Failed')](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3373) 
**Quality Gate failed**  
   Failed conditions  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png
 '') [1 Security 
Hotspot](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3373&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
  
 
   
   
   [See analysis details on SonarQube 
Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3373)
   
   


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



Re: [PR] feat(metadata): strengthen service-app mapping consistency, retry and… [dubbo-go]

2026-06-07 Thread via GitHub


Alanxtl commented on PR #3373:
URL: https://github.com/apache/dubbo-go/pull/3373#issuecomment-4646171351

   pls update to latest develop branch to fix ci fail
   然后修一下sonarcloud的ci fail


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



Re: [PR] feat(metadata): strengthen service-app mapping consistency, retry and… [dubbo-go]

2026-06-07 Thread via GitHub


sonarqubecloud[bot] commented on PR #3373:
URL: https://github.com/apache/dubbo-go/pull/3373#issuecomment-4642027720

   ## [![Quality Gate 
Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png
 'Quality Gate 
Failed')](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3373) 
**Quality Gate failed**  
   Failed conditions  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png
 '') [2 Security 
Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3373&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
  
 
   
   
   [See analysis details on SonarQube 
Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3373)
   
   


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



Re: [PR] feat(metadata): strengthen service-app mapping consistency, retry and… [dubbo-go]

2026-06-07 Thread via GitHub


NeverENG commented on code in PR #3373:
URL: https://github.com/apache/dubbo-go/pull/3373#discussion_r3369039548


##
metadata/report/nacos/report.go:
##
@@ -165,30 +162,42 @@ func (n *nacosMetadataReport) 
RegisterServiceAppMapping(key string, group string
DataId: key,
Group:  group,
})
-   if oldVal != "" {
-   oldApps := strings.Split(oldVal, constant.CommaSeparator)
-   if len(oldApps) > 0 {
-   for _, app := range oldApps {
-   if app == value {
-   return nil
-   }
-   }
-   }
-   value = oldVal + constant.CommaSeparator + value
+   merged, changed := report.MergeServiceAppMapping(oldVal, value)
+   if !changed {
+   return nil
}
-   return n.storeMetadata(vo.ConfigParam{
+   param := vo.ConfigParam{
DataId:  key,
Group:   group,
-   Content: value,
-   })
+   Content: merged,
+   }
+   if oldVal != "" {
+   // CasMd5 is an optimistic UPDATE: Nacos publishes only if the 
server content still
+   // matches what we read, detecting concurrent appends. It 
cannot guard the first INSERT
+   // (Nacos has no create-if-absent), so the initial concurrent 
registration of a
+   // brand-new interface can still race. This is a known 
Nacos-only limitation; the
+   // etcd and zookeeper reports do not have it.
+   param.CasMd5 = fmt.Sprintf("%x", md5.Sum([]byte(oldVal)))
+   }
+   if err := n.storeMetadata(param); err != nil {
+   if param.CasMd5 != "" {
+   // Nacos surfaces a CAS rejection and a transport error 
the same way, so they
+   // cannot be told apart here. Treat the failure as a 
retriable conflict rather
+   // than risk dropping a real concurrent update; the 
underlying error is preserved
+   // for diagnosis.
+   return fmt.Errorf("publish mapping %s (%v): %w", key, 
err, report.ErrMappingCASConflict)
+   }
+   return err
+   }
+   return nil
 }

Review Comment:
   问题已解决
   换算法应该不影响,#3370 是 app+revision -> MetaDataInfo 的映射。#3373(本PR)是 
service-app-mapping,interface 到 app 到映射,这里的 md5 是 nacos 为实现 CAS 乐观锁的指纹,修改 #3370 
对本 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]



Re: [PR] feat(metadata): strengthen service-app mapping consistency, retry and… [dubbo-go]

2026-06-07 Thread via GitHub


sonarqubecloud[bot] commented on PR #3373:
URL: https://github.com/apache/dubbo-go/pull/3373#issuecomment-4641970719

   ## [![Quality Gate 
Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png
 'Quality Gate 
Failed')](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3373) 
**Quality Gate failed**  
   Failed conditions  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png
 '') [2 Security 
Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3373&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
  
 
   
   
   [See analysis details on SonarQube 
Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3373)
   
   


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



Re: [PR] feat(metadata): strengthen service-app mapping consistency, retry and… [dubbo-go]

2026-06-06 Thread via GitHub


Alanxtl commented on code in PR #3373:
URL: https://github.com/apache/dubbo-go/pull/3373#discussion_r3368861526


##
metadata/report/nacos/report.go:
##
@@ -165,30 +162,42 @@ func (n *nacosMetadataReport) 
RegisterServiceAppMapping(key string, group string
DataId: key,
Group:  group,
})
-   if oldVal != "" {
-   oldApps := strings.Split(oldVal, constant.CommaSeparator)
-   if len(oldApps) > 0 {
-   for _, app := range oldApps {
-   if app == value {
-   return nil
-   }
-   }
-   }
-   value = oldVal + constant.CommaSeparator + value
+   merged, changed := report.MergeServiceAppMapping(oldVal, value)
+   if !changed {
+   return nil
}
-   return n.storeMetadata(vo.ConfigParam{
+   param := vo.ConfigParam{
DataId:  key,
Group:   group,
-   Content: value,
-   })
+   Content: merged,
+   }
+   if oldVal != "" {
+   // CasMd5 is an optimistic UPDATE: Nacos publishes only if the 
server content still
+   // matches what we read, detecting concurrent appends. It 
cannot guard the first INSERT
+   // (Nacos has no create-if-absent), so the initial concurrent 
registration of a
+   // brand-new interface can still race. This is a known 
Nacos-only limitation; the
+   // etcd and zookeeper reports do not have it.
+   param.CasMd5 = fmt.Sprintf("%x", md5.Sum([]byte(oldVal)))
+   }
+   if err := n.storeMetadata(param); err != nil {
+   if param.CasMd5 != "" {
+   // Nacos surfaces a CAS rejection and a transport error 
the same way, so they
+   // cannot be told apart here. Treat the failure as a 
retriable conflict rather
+   // than risk dropping a real concurrent update; the 
underlying error is preserved
+   // for diagnosis.
+   return fmt.Errorf("publish mapping %s (%v): %w", key, 
err, report.ErrMappingCASConflict)
+   }
+   return err
+   }
+   return nil
 }

Review Comment:
   Nacos 读失败会被当成空旧值继续写,可能覆盖已有 mapping。 
   
   这里 `oldVal, _ := n.getConfig(...)` 仍然吞掉错误。若 Nacos 读因为网络/权限/服务端异常失败,但 key 
实际已有 `appA,appB`,这里会按 `oldVal == ""` 生成 `Content: appC` 且不带 
`CasMd5`,最后可能无条件覆盖旧集合。这个 bug 在 base 已存在,但这个 PR 的核心就是“mapping 
consistency”,所以这里必须顺手修掉:`getConfig` error 应该返回或进入可控重试,不能继续 publish。
   
   
   另外我们要把md5算法换掉[#3370](https://github.com/apache/dubbo-go/pull/3370)
   casmd5会不会受到影响



##
metadata/report/zookeeper/listener.go:
##
@@ -116,6 +116,15 @@ func (l *CacheListener) RemoveListener(key string, 
listener mapping.MappingListe
}
 }
 
+// RemoveKeyListeners drops all listeners registered for key so its mapping 
change events stop
+// being dispatched. The dispatcher goroutine is shared by the whole mapping 
group and is kept
+// alive (other keys still need it); it is released when the report is closed. 
The key's
+// underlying ZooKeeper watch is not unregistered here, as ZkEventListener 
exposes no per-path
+// unlisten, so the server may keep sending now-ignored events for the key.
+func (l *CacheListener) RemoveKeyListeners(key string) {
+   l.keyListeners.Delete(key)
+}

Review Comment:
   Zookeeper listener 路径没有复用新的 decode helper,事件里仍可能带空 app。
   
   129行func (l *CacheListener) DataChange(event remoting.Event) bool {
   
   仍然直接 strings.Split 后全量 set.Add(e)。如果已有 legacy 值是 ,app、app,,other 
这类格式,GetServiceAppMapping 会过滤空元素,但 ZK change event 会把 "" 发给 consumer。建议这里也改成 
report.DecodeServiceAppNames(event.Content),并补 listener event 测试。



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



Re: [PR] feat(metadata): strengthen service-app mapping consistency, retry and… [dubbo-go]

2026-06-06 Thread via GitHub


Alanxtl commented on PR #3373:
URL: https://github.com/apache/dubbo-go/pull/3373#issuecomment-4641642421

   先看一下应该没和#3371重复吧


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



Re: [PR] feat(metadata): strengthen service-app mapping consistency, retry and… [dubbo-go]

2026-06-06 Thread via GitHub


sonarqubecloud[bot] commented on PR #3373:
URL: https://github.com/apache/dubbo-go/pull/3373#issuecomment-4641384718

   ## [![Quality Gate 
Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png
 'Quality Gate 
Failed')](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3373) 
**Quality Gate failed**  
   Failed conditions  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png
 '') [2 Security 
Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3373&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
  
 
   
   
   [See analysis details on SonarQube 
Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3373)
   
   


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



Re: [PR] feat(metadata): strengthen service-app mapping consistency, retry and… [dubbo-go]

2026-06-06 Thread via GitHub


sonarqubecloud[bot] commented on PR #3373:
URL: https://github.com/apache/dubbo-go/pull/3373#issuecomment-4641381896

   ## [![Quality Gate 
Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png
 'Quality Gate 
Failed')](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3373) 
**Quality Gate failed**  
   Failed conditions  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png
 '') [2 Security 
Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3373&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
  
 
   
   
   [See analysis details on SonarQube 
Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3373)
   
   


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



Re: [PR] feat(metadata): strengthen service-app mapping consistency, retry and… [dubbo-go]

2026-06-06 Thread via GitHub


sonarqubecloud[bot] commented on PR #3373:
URL: https://github.com/apache/dubbo-go/pull/3373#issuecomment-4641354383

   ## [![Quality Gate 
Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png
 'Quality Gate 
Failed')](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3373) 
**Quality Gate failed**  
   Failed conditions  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png
 '') [2 Security 
Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3373&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
  
 
   
   
   [See analysis details on SonarQube 
Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3373)
   
   


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