mochengqian commented on code in PR #961:
URL: https://github.com/apache/dubbo-go-pixiu/pull/961#discussion_r3369853743


##########
pkg/server/cluster_manager.go:
##########
@@ -942,7 +952,7 @@ func (s *ClusterStore) DeleteEndpoint(clusterName string, 
endpointID string) {
                if e.ID == endpointID {
                        runtimeCluster.RemoveEndpoint(e)
                        clusterConfig.Endpoints = 
append(clusterConfig.Endpoints[:i], clusterConfig.Endpoints[i+1:]...)
-                       s.prepareClusterConfig(clusterConfig)
+                       s.prepareOwnedClusterConfig(clusterConfig)

Review Comment:
   DeleteEndpoint 现在删除后直接走 prepareOwnedClusterConfig,不再像旧路径那样通过 
prepareClusterConfig 全量 clone。这样 append(clusterConfig.Endpoints[:i], 
clusterConfig.Endpoints[i+1:]...) 缩短 slice 后不会清理 backing array 的尾部指针。删除尾部 
endpoint,尤其是连续删除尾部时,已删除 endpoint 及其 Metadata / LLMMeta 可能被 backing array 
继续持有,直到 cluster 被替换或 slice 重新分配。



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