Copilot commented on code in PR #7100:
URL: https://github.com/apache/shenyu/pull/7100#discussion_r4032810312
##########
shenyu-plugin/shenyu-plugin-proxy/shenyu-plugin-rpc/shenyu-plugin-tars/src/main/java/org/apache/shenyu/plugin/tars/handler/TarsMetaDataHandler.java:
##########
@@ -43,7 +43,7 @@ public void handle(final MetaData metaData) {
MetaData metaExist = META_DATA.get(metaData.getPath());
List<TarsInvokePrx> prxList = ApplicationConfigCache.getInstance()
.get(metaData.getPath()).getTarsInvokePrxList();
- boolean exist = prxList.stream().anyMatch(tarsInvokePrx ->
tarsInvokePrx.getHost().equals(metaData.getAppName()));
+ boolean exist = prxList.stream().anyMatch(tarsInvokePrx ->
Objects.equals(tarsInvokePrx.getAppName(), metaData.getAppName()));
Review Comment:
This treats every event for an already-cached application as a duplicate,
including real metadata updates. For example, if `serviceName` changes while
`path` and `appName` stay the same, `initPrx` is skipped and the cached proxy
continues using the old object name (the proxy is built from
`metaData.getServiceName()` in
`ApplicationConfigCache.refreshTarsInvokePrxList`). Metadata UPDATE events are
delivered through `onSubscribe`, and the Dubbo/Sofa handlers explicitly
distinguish changed metadata from duplicates. Please suppress only unchanged
events, refresh/rebuild the proxy for invocation-relevant changes, and replace
the `META_DATA` entry after handling; add a regression case for a
same-application service update.
--
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]