[BUG] Discovery upstream delete events leave stale gateway cache entries
- Dominant language
- Java
- Stars
- 8.8k
- Forks
- 3.1k
- Avg merge
- 7d 1h
- Merged PRs (30d)
- 85
Description
### Current Behavior
Discovery upstream delete events are not applied to gateway-side caches.
For path-based sync, admin deletes discovery-upstream nodes under `/.../discoveryUpstream//`, but `AbstractPathDataSyncService.discoveryUpstreamHandlerEvent()` ignores `DELETE` events entirely:
```java
if (!EventType.DELETE.equals(eventType)) {
... cacheDiscoveryUpstreamData(...)
}
```
For node/websocket-style sync paths, delete events can reach `DiscoveryUpstreamDataSubscriber.unSubscribe(...)`, but `CommonDiscoveryUpstreamDataSubscriber.unSubscribe()` is currently a no-op.
### Expected Behavior
Deleting discovery upstream data in admin should remove or refresh the corresponding gateway-side upstream cache for the plugin/selector.
### Impact
Deleted discovery upstreams can remain cached and routable in gateway instances after admin has removed them. This affects path-based sync backends and any backend that reaches the common no-op unsubscribe path.
### Code Location
- `shenyu-admin-listener/shenyu-admin-listener-api/src/main/java/org/apache/shenyu/admin/listener/AbstractPathDataChangedListener.java`
- deletes discovery upstream paths.
- `shenyu-sync-data-center/shenyu-sync-data-api/src/main/java/org/apache/shenyu/sync/data/core/AbstractPathDataSyncService.java`
- `discoveryUpstreamHandlerEvent()` ignores deletes.
- `shenyu-plugin/shenyu-plugin-base/src/main/java/org/apache/shenyu/plugin/base/cache/CommonDiscoveryUpstreamDataSubscriber.java`
- `unSubscribe()` is a no-op.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with discovery-upstream deletion in AbstractPathDataChangedListener.java, then trace discoveryUpstreamHandlerEvent() in AbstractPathDataSyncService.java and unSubscribe() in CommonDiscoveryUpstreamDataSubscriber.java. Verify how both path-based and node/websocket-style sync handle DELETE events, and confirm that deleting admin data removes or refreshes the corresponding gateway cache for the plugin and selector.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100