Similarityoung commented on code in PR #1023:
URL: https://github.com/apache/dubbo-go-pixiu/pull/1023#discussion_r4053026681


##########
pkg/filter/http/grpcproxy/connection_manager.go:
##########
@@ -373,6 +373,14 @@ func (m *grpcConnectionManager) 
RemoveEndpoint(clusterName, endpoint string) {
 // a connection created after the endpoint was re-added.
 func (m *grpcConnectionManager) UpdateEndpointState(clusterName, endpoint 
string, present bool, eventVersion uint64) {
        key := grpcConnectionKey(clusterName, endpoint)
+       // Lifecycle callbacks are delivered outside the cluster manager lock 
and can
+       // therefore arrive out of order. Once a bounded tombstone has been 
evicted,
+       // its version watermark is no longer available to reject an old 
removal.
+       // The cluster snapshot is authoritative in that case: do not let a 
delayed
+       // removal turn an endpoint that is currently present back into a 
tombstone.
+       if !present && m.isEndpointPresent(key, endpoint) {

Review Comment:
   isEndpointPresent() 在 endpointPresent == nil 时会返回 true,所以这里会直接跳过所有 
present=false 的事件。
   
   建议只在 endpointPresent != nil 时做这个判断。
   
   另外,当前 tombstone 测试也可能因此变成空跑,最好补一个断言确认 removal state 确实被记录。



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