Copilot commented on code in PR #7055:
URL: https://github.com/apache/shenyu/pull/7055#discussion_r3985718294
##########
shenyu-plugin/shenyu-plugin-base/src/main/java/org/apache/shenyu/plugin/base/AbstractShenyuPlugin.java:
##########
@@ -99,9 +99,11 @@ public Mono<Void> execute(final ServerWebExchange exchange,
final ShenyuPluginCh
if (Objects.nonNull(selectorData) &&
StringUtils.isBlank(selectorData.getId())) {
return handleSelectorIfNull(pluginName, exchange, chain);
}
- selectorData = defaultMatchSelector(exchange, selectors, path);
if (Objects.isNull(selectorData)) {
- return handleSelectorIfNull(pluginName, exchange, chain);
+ selectorData = defaultMatchSelector(exchange, selectors, path);
+ if (Objects.isNull(selectorData)) {
Review Comment:
This branch now trusts the cached selector without re-evaluating the current
selector list. Cache invalidation removes entries only when the changed
selector's ID is the cached value; adding or changing a different
higher-priority selector therefore leaves an existing path-to-old-selector
entry intact, so requests can keep using the old selector until eviction.
Invalidate the plugin's selector cache, or all entries affected by
selector-list changes, before relying on this cache.
This issue also appears on line 131 of the same file.
--
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]