BraveheartStone opened a new issue, #6144:
URL: https://github.com/apache/shenyu/issues/6144
### Is there an existing issue for this?
- [x] I have searched the existing issues
### Current Behavior
下游服务通过容器部署,目前只部署了一个节点。shenyu 通过 nacos 发现下游业务服务。当下游服务重启后,此服务旧的 IP 会覆盖新的
IP,导致通过 shenyu 使用 https 协议调用下游服务的 api 时报错:"Can not find healthy upstream url,
please check your configuration!"
下游服务重启后,bootstrap 收到的 websocket 日志如下:
```
2025-09-08 11:36:48 [WebSocketConnectReadThread-31] INFO
org.apache.shenyu.plugin.sync.data.websocket.client.ShenyuWebsocketClient -
server [ws://localhost:9095/websocket]
handleResult({"groupType":"DISCOVER_UPSTREAM","eventType":"UPDATE","data":[{"selectorId":"1964881053955350528","pluginName":"divide","selectorName":"server-order","upstreamDataList":[{"id":"1965016462289838080","dateCreated":"2025-09-08
11:36:47","dateUpdated":"2025-09-08
11:36:47","discoveryHandlerId":"1964881055377219584","protocol":"http://","url":"172.22.104.133:8001","status":0,"weight":1,"namespaceId":"649330b6-c2d7-4edc-be8e-8a54df9eb385"}],"namespaceId":"649330b6-c2d7-4edc-be8e-8a54df9eb385"}]})
2025-09-08 11:36:53 [WebSocketConnectReadThread-31] INFO
org.apache.shenyu.plugin.sync.data.websocket.client.ShenyuWebsocketClient -
server [ws://localhost:9095/websocket]
handleResult({"groupType":"DISCOVER_UPSTREAM","eventType":"UPDATE","data":[{"selectorId":"1964881053955350528","pluginName":"divide","selectorName":"server-order","upstreamDataList":[{"discoveryHandlerId":"1964881055377219584","protocol":"http://","url":"172.22.104.65:8001","status":1,"weight":1,"namespaceId":"649330b6-c2d7-4edc-be8e-8a54df9eb385"}],"namespaceId":"649330b6-c2d7-4edc-be8e-8a54df9eb385"}]})
2025-09-08 11:39:26 [WebSocketConnectReadThread-31] INFO
org.apache.shenyu.plugin.sync.data.websocket.client.ShenyuWebsocketClient -
server [ws://localhost:9095/websocket]
handleResult({"groupType":"DISCOVER_UPSTREAM","eventType":"UPDATE","data":[{"selectorId":"1964881053955350528","pluginName":"divide","selectorName":"server-order","upstreamDataList":[{"id":"1965017125572878336","dateCreated":"2025-09-08
11:39:25","dateUpdated":"2025-09-08
11:39:25","discoveryHandlerId":"1964881055377219584","protocol":"http://","url":"172.22.104.65:8001","status":0,"weight":1,"namespaceId":"649330b6-c2d7-4edc-be8e-8a54df9eb385"}],"namespaceId":"649330b6-c2d7-4edc-be8e-8a54df9eb385"}]})
2025-09-08 11:39:29 [WebSocketConnectReadThread-31] INFO
org.apache.shenyu.plugin.sync.data.websocket.client.ShenyuWebsocketClient -
server [ws://localhost:9095/websocket]
handleResult({"groupType":"DISCOVER_UPSTREAM","eventType":"UPDATE","data":[{"selectorId":"1964881053955350528","pluginName":"divide","selectorName":"server-order","upstreamDataList":[{"discoveryHandlerId":"1964881055377219584","protocol":"http://","url":"172.22.104.133:8001","status":1,"weight":1,"namespaceId":"649330b6-c2d7-4edc-be8e-8a54df9eb385"}],"namespaceId":"649330b6-c2d7-4edc-be8e-8a54df9eb385"}]})
```
WebSocket 推送的情况:
11:36:48 → 推送了 172.22.104.133:8001,status=0
11:36:53 → 推送了 172.22.104.65:8001,status=1 ✅
11:39:26 → 又推送了 172.22.104.65:8001,status=0
11:39:29 → 又推送了 172.22.104.133:8001,status=1 ✅
实际上 172.22.104.65 才是服务的最新IP,而 172.22.104.133 是服务的旧 IP。
但 shenyu-admin 中展示的是正确的:
<img width="1278" height="529" alt="Image"
src="https://github.com/user-attachments/assets/323e5466-8347-4cfc-9dcd-91b4d05de3b2"
/>
### Expected Behavior
服务重新部署后,shenyu-bootstrap 能正确识别最新的ip,在后续的调用中能够正常调通。
### Steps To Reproduce
1. 业务服务启动完成
2. 启动 shenyu-admin 完成
3. 启动 shenyu-bootstrap 完成
4. 配置Divide 的 Selector 和 rule,通过 nacos 发现下游服务
5. 测试调用下游服务成功
6. 重新部署下游服务完成
7. 再次通过网关调用下游服务报错:"Can not find healthy upstream url, please check your
configuration!"
### Environment
```markdown
ShenYu version(s):2.7.0.2
```
### Debug logs
完成上下游日志:
```
2025-09-08 11:36:36 [shenyu-netty-epoll-8] INFO
org.apache.shenyu.plugin.base.AbstractShenyuPlugin - divide selector success
match , selector name :server-order
2025-09-08 11:36:36 [shenyu-netty-epoll-8] INFO
org.apache.shenyu.plugin.base.AbstractShenyuPlugin - divide rule match path
from default strategy
2025-09-08 11:36:36 [shenyu-netty-epoll-8] INFO
org.apache.shenyu.plugin.base.AbstractShenyuPlugin - divide rule success match
, rule name :server-order
2025-09-08 11:36:48 [WebSocketConnectReadThread-31] INFO
org.apache.shenyu.plugin.sync.data.websocket.client.ShenyuWebsocketClient -
server [ws://localhost:9095/websocket]
handleResult({"groupType":"DISCOVER_UPSTREAM","eventType":"UPDATE","data":[{"selectorId":"1964881053955350528","pluginName":"divide","selectorName":"server-order","upstreamDataList":[{"id":"1965016462289838080","dateCreated":"2025-09-08
11:36:47","dateUpdated":"2025-09-08
11:36:47","discoveryHandlerId":"1964881055377219584","protocol":"http://","url":"172.22.104.133:8001","status":0,"weight":1,"namespaceId":"649330b6-c2d7-4edc-be8e-8a54df9eb385"}],"namespaceId":"649330b6-c2d7-4edc-be8e-8a54df9eb385"}]})
2025-09-08 11:36:53 [WebSocketConnectReadThread-31] INFO
org.apache.shenyu.plugin.sync.data.websocket.client.ShenyuWebsocketClient -
server [ws://localhost:9095/websocket]
handleResult({"groupType":"DISCOVER_UPSTREAM","eventType":"UPDATE","data":[{"selectorId":"1964881053955350528","pluginName":"divide","selectorName":"server-order","upstreamDataList":[{"discoveryHandlerId":"1964881055377219584","protocol":"http://","url":"172.22.104.65:8001","status":1,"weight":1,"namespaceId":"649330b6-c2d7-4edc-be8e-8a54df9eb385"}],"namespaceId":"649330b6-c2d7-4edc-be8e-8a54df9eb385"}]})
2025-09-08 11:39:26 [WebSocketConnectReadThread-31] INFO
org.apache.shenyu.plugin.sync.data.websocket.client.ShenyuWebsocketClient -
server [ws://localhost:9095/websocket]
handleResult({"groupType":"DISCOVER_UPSTREAM","eventType":"UPDATE","data":[{"selectorId":"1964881053955350528","pluginName":"divide","selectorName":"server-order","upstreamDataList":[{"id":"1965017125572878336","dateCreated":"2025-09-08
11:39:25","dateUpdated":"2025-09-08
11:39:25","discoveryHandlerId":"1964881055377219584","protocol":"http://","url":"172.22.104.65:8001","status":0,"weight":1,"namespaceId":"649330b6-c2d7-4edc-be8e-8a54df9eb385"}],"namespaceId":"649330b6-c2d7-4edc-be8e-8a54df9eb385"}]})
2025-09-08 11:39:29 [WebSocketConnectReadThread-31] INFO
org.apache.shenyu.plugin.sync.data.websocket.client.ShenyuWebsocketClient -
server [ws://localhost:9095/websocket]
handleResult({"groupType":"DISCOVER_UPSTREAM","eventType":"UPDATE","data":[{"selectorId":"1964881053955350528","pluginName":"divide","selectorName":"server-order","upstreamDataList":[{"discoveryHandlerId":"1964881055377219584","protocol":"http://","url":"172.22.104.133:8001","status":1,"weight":1,"namespaceId":"649330b6-c2d7-4edc-be8e-8a54df9eb385"}],"namespaceId":"649330b6-c2d7-4edc-be8e-8a54df9eb385"}]})
2025-09-08 11:39:55 [shenyu-netty-epoll-9] INFO
org.apache.shenyu.plugin.base.AbstractShenyuPlugin - customSign selector match
success from default strategy
2025-09-08 11:39:55 [shenyu-netty-epoll-9] INFO
org.apache.shenyu.plugin.base.AbstractShenyuPlugin - customSign selector
success match , selector name :custom-server-order
2025-09-08 11:39:55 [shenyu-netty-epoll-9] INFO
org.apache.shenyu.plugin.base.AbstractShenyuPlugin - customSign rule match path
from default strategy
```
### Anything else?
_No response_
--
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]