AlexStocks opened a new issue, #3573:
URL: https://github.com/apache/dubbo-go/issues/3573

   ## 问题描述
   
   registry、config-center、metadata-report 三个角色各自通过 
`zookeeper.ValidateZookeeperClient(...)`(来自 
`github.com/dubbogo/gost/database/kv/zk`)创建**独立**的 
`*gxzookeeper.ZookeeperClient`:
   
   - `registry/zookeeper/registry.go` L69 `zookeeper.ValidateZookeeperClient(r, 
url.Location)`
   - `config_center/zookeeper/impl.go` L83 
`zookeeper.ValidateZookeeperClient(c, url.Location)`
   - `metadata/report/zookeeper/report.go` L216 
`gxzookeeper.NewZookeeperClient(...)`
   
   etcd / Nacos 实现同理,各自 new 一套 client。
   
   ## 影响
   
   单个 dubbo-go 应用对**同一个** ZK/etcd/Nacos 集群,同时维持 registry + config-center + 
metadata-report **三套连接/会话**。连接数与服务端 session 压力 ×3,在大规模部署下客户端连接数可观。
   
   ## 建议修复
   
   - 允许用户注入/共享同一个后端 client(例如通过 `WithXxxClient` option 或全局 client 
池),让三个角色复用同一连接;
   - 或在框架层提供 backend client 工厂,按地址复用单例连接。
   
   ## 参考
   
   - `registry/zookeeper/registry.go` L69
   - `config_center/zookeeper/impl.go` L83
   - `metadata/report/zookeeper/report.go` L216
   


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