- Severity: High
- Location:
shenyu-sync-data-center/shenyu-sync-data-api/src/main/java/org/apache/shenyu/sync/data/core/AbstractPathDataSyncService.java:132-141
Description:
The method body is if (!EventType.DELETE.equals(eventType)) { Optional.ofNullable(updateData).ifPresent(e -> cacheDiscoveryUpstreamData(...)); } — no else branch for DELETE; no unCacheDiscoveryUpstreamData call (or method) exists. The etcd watchChildChange delete callback (EtcdSyncDataService.java:88) correctly fires super.event(..., null, ..., EventType.DELETE) for discovery upstream deletions, and event() dispatches to discoveryUpstreamHandlerEvent, but the handler silently drops it. Every other handler (pluginHandlerEvent, selectorHandlerEvent, ruleHandlerEvent:144-146, appAuthHandlerEvent:153-155, metaDataHandlerEvent:161-167, proxyHandlerEvent:118-123) correctly handles DELETE — only discovery upstream is missing.
Impact:
On etcd sync, when a discovery upstream is deleted, the gateway never removes it from the subscriber cache. Stale upstream endpoints continue to receive traffic.
Suggested fix:
Add a DELETE branch that parses plugin name and selector name from updatePath (same split("/") pattern as proxyHandlerEvent), constructs a DiscoverySyncData, and calls a new unCacheDiscoveryUpstreamData(...) that delegates to discoveryUpstreamDataSubscribers.forEach(e -> e.unSubscribe(...)).
Confidence: High
Identified during the 2026-08-02 deep re-scan; full list in docs/scan2-2026-08-02/00-consolidated-critical-high.md.
shenyu-sync-data-center/shenyu-sync-data-api/src/main/java/org/apache/shenyu/sync/data/core/AbstractPathDataSyncService.java:132-141Description:
The method body is
if (!EventType.DELETE.equals(eventType)) { Optional.ofNullable(updateData).ifPresent(e -> cacheDiscoveryUpstreamData(...)); }— noelsebranch for DELETE; nounCacheDiscoveryUpstreamDatacall (or method) exists. The etcdwatchChildChangedelete callback (EtcdSyncDataService.java:88) correctly firessuper.event(..., null, ..., EventType.DELETE)for discovery upstream deletions, andevent()dispatches todiscoveryUpstreamHandlerEvent, but the handler silently drops it. Every other handler (pluginHandlerEvent,selectorHandlerEvent,ruleHandlerEvent:144-146,appAuthHandlerEvent:153-155,metaDataHandlerEvent:161-167,proxyHandlerEvent:118-123) correctly handles DELETE — only discovery upstream is missing.Impact:
On etcd sync, when a discovery upstream is deleted, the gateway never removes it from the subscriber cache. Stale upstream endpoints continue to receive traffic.
Suggested fix:
Add a
DELETEbranch that parses plugin name and selector name fromupdatePath(samesplit("/")pattern asproxyHandlerEvent), constructs aDiscoverySyncData, and calls a newunCacheDiscoveryUpstreamData(...)that delegates todiscoveryUpstreamDataSubscribers.forEach(e -> e.unSubscribe(...)).Confidence: High
Identified during the 2026-08-02 deep re-scan; full list in
docs/scan2-2026-08-02/00-consolidated-critical-high.md.