Aias00 opened a new issue, #6480:
URL: https://github.com/apache/shenyu/issues/6480
### Current Behavior
Proxy selector delete events publish the selector id, but gateway-side
removal treats that value as the selector name.
Admin path/node listeners write proxy selector keys using
`ProxySelectorData.getId()`:
```java
DefaultPathConstants.buildProxySelectorPath(data.getNamespaceId(),
data.getPluginName(), data.getId())
```
On delete, sync consumers reconstruct `ProxySelectorData` with that leaf
value placed into `name`:
```java
proxySelectorData.setName(proxySelectorName);
```
`CommonProxySelectorDataSubscriber` then removes by
`proxySelectorData.getName()`. The TCP handler caches bootstrap servers by the
real selector name from live selector data, so if `id != name`, the delete
event cannot remove the cached TCP server.
### Expected Behavior
Proxy selector delete events should use the same identity that plugin
handlers use for cache registration, or should carry both id and name so the
correct cached resource can be removed.
### Impact
Deleting a TCP proxy selector can leave the old `BootstrapServer` cached and
running when the selector id differs from the selector name.
### Code Location
-
`shenyu-admin-listener/shenyu-admin-listener-api/src/main/java/org/apache/shenyu/admin/listener/AbstractPathDataChangedListener.java`
-
`shenyu-admin-listener/shenyu-admin-listener-api/src/main/java/org/apache/shenyu/admin/listener/AbstractNodeDataChangedListener.java`
- proxy selector delete keys are based on selector id.
-
`shenyu-sync-data-center/shenyu-sync-data-api/src/main/java/org/apache/shenyu/sync/data/core/AbstractPathDataSyncService.java`
-
`shenyu-sync-data-center/shenyu-sync-data-api/src/main/java/org/apache/shenyu/sync/data/core/AbstractNodeDataSyncService.java`
- delete consumers put the key leaf into `name`.
-
`shenyu-plugin/shenyu-plugin-base/src/main/java/org/apache/shenyu/plugin/base/cache/CommonProxySelectorDataSubscriber.java`
-
`shenyu-plugin/shenyu-plugin-proxy/shenyu-plugin-tcp/src/main/java/org/apache/shenyu/plugin/tcp/handler/TcpProxySelectorDataHandler.java`
- TCP removal is by selector name.
--
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]