- Severity: Medium
- Location:
shenyu-sync-data-center/shenyu-sync-data-websocket/src/main/java/org/apache/shenyu/plugin/sync/data/websocket/handler/DiscoveryUpstreamDataHandler.java:40-42
Description:
doRefresh directly calls data.forEach(... onSubscribe) without first calling refresh() on subscribers. AuthDataHandler.doRefresh() (line 43: authDataSubscribers.forEach(AuthDataSubscriber::refresh)) and ProxySelectorDataHandler.doRefresh() (line 45) both clear stale data first then re-add. DiscoveryUpstreamDataHandler is the only handler that skips the clear step.
Impact:
On a WebSocket REFRESH event for discovery upstreams, stale upstream data is not cleared before new data is added; old discovery entries no longer present in the refresh payload persist.
Suggested fix:
Add discoveryUpstreamDataSubscribers.forEach(DiscoveryUpstreamDataSubscriber::refresh) as the first line of doRefresh, matching AuthDataHandler and ProxySelectorDataHandler.
Confidence: High
Identified during the 2026-08-02 deep re-scan; full list in docs/scan2-2026-08-02/06-medium-tiers.md.
shenyu-sync-data-center/shenyu-sync-data-websocket/src/main/java/org/apache/shenyu/plugin/sync/data/websocket/handler/DiscoveryUpstreamDataHandler.java:40-42Description:
doRefreshdirectly callsdata.forEach(... onSubscribe)without first callingrefresh()on subscribers.AuthDataHandler.doRefresh()(line 43:authDataSubscribers.forEach(AuthDataSubscriber::refresh)) andProxySelectorDataHandler.doRefresh()(line 45) both clear stale data first then re-add.DiscoveryUpstreamDataHandleris the only handler that skips the clear step.Impact:
On a WebSocket REFRESH event for discovery upstreams, stale upstream data is not cleared before new data is added; old discovery entries no longer present in the refresh payload persist.
Suggested fix:
Add
discoveryUpstreamDataSubscribers.forEach(DiscoveryUpstreamDataSubscriber::refresh)as the first line ofdoRefresh, matchingAuthDataHandlerandProxySelectorDataHandler.Confidence: High
Identified during the 2026-08-02 deep re-scan; full list in
docs/scan2-2026-08-02/06-medium-tiers.md.