AlexStocks commented on code in PR #3635:
URL: https://github.com/apache/dubbo-go/pull/3635#discussion_r3837947539


##########
remoting/nacos/builder.go:
##########
@@ -43,6 +43,23 @@ var (
        newNacosConfigClient = nacosClient.NewNacosConfigClient
 )
 
+// nacosClientPoolKey derives the gost client-pool key from the fields that
+// distinguish one nacos connection from another: endpoint/address, namespace
+// and credentials. Components pointing at the same cluster (registry,
+// config-center, metadata-report) resolve to the same key and share one SDK
+// client session instead of each opening its own. Role-scoped client names
+// must not be used as the key — they would defeat the sharing.
+func nacosClientPoolKey(kind string, url *common.URL) string {

Review Comment:
   [P1] 这个根因仍没有完全修复:当前 key 仍可能让不同认证/安全配置复用同一个 first-writer-wins SDK 
client。`GetNacosConfig` 会把 `NacosOpenKmsKey` 和 `NacosRegionIDKey` 写入 
`ClientConfig`,但 `nacosClientPoolKey` 没有包含它们;判别测试中,相同 
endpoint/namespace/AK/SK、仅 `OpenKMS=false` 与 `OpenKMS=true, 
RegionId=cn-hangzhou` 的两个有效配置得到完全相同的 `...|cred0` 
key,后创建者会静默沿用第一个客户端的加密模式。另一个碰撞来自 
`credentialID`:四个凭证字段用换行连接,`username="alice\nteam", password="secret"` 与 
`username="alice", password="team\nsecret"` 会形成相同 tuple,也得到同一个 
`cred0`。请用可比较的结构体(如 `[4]string`)保存凭证元组,并把会改变认证/加密行为的配置纳入规范化池身份;回归测试应同时覆盖 
KMS/Region 差异和包含分隔符的凭证。



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

Reply via email to