Aias00 commented on code in PR #7276:
URL: https://github.com/apache/shenyu/pull/7276#discussion_r4110028491


##########
shenyu-registry/shenyu-registry-apollo/src/main/java/org/apache/shenyu/registry/apollo/ApolloInstanceRegisterRepository.java:
##########
@@ -145,8 +145,9 @@ public List<InstanceEntity> selectInstances(final String 
selectKey) {
                 if (key.startsWith(watchKey)) {
                     switch (changeEvent.getChange(key).getChangeType()) {
                         case ADDED:
+                        case MODIFIED:

Review Comment:
   Non-blocking nit: with `ADDED` and `MODIFIED` sharing one log line, 
operators can no longer tell a new registration from an instance move. Keeping 
two messages (or adding the key and the type) preserves that.
   
   Separately - already noted in the review body - this change makes the 
per-call `childrenList` more load-bearing: two concurrent 
`selectInstances(selectKey)` calls before `watcherInstanceRegisterMap` is 
populated keep different maps and both write their own derived list on every 
event, so update visibility can be lost. Guarding with 
`configChangeListenerMap.computeIfAbsent(watchKey, ...)` would give one view 
per watch key; suggested as a follow-up, not here.



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

Reply via email to