The client has been closed and will not reconnect
- Dominant language
- Java
- Stars
- 41.6k
- Forks
- 26.4k
- Avg merge
- 15h 13m
- Merged PRs (30d)
- 4
Description
* Dubbo version: 3.2.2
* Operating System version: xxx
* nacos server: 2.0.3
* nacos client: 2.2.2
* Java version: 1.8
为什么收到服务变更通知,然后连上了,但是随后又立即关闭了,而且也不再重连了,导致这个消费者永远调不到这个提供者了
这个是启动日志
```
2023-06-29 18:09:32.786 [nacos.publisher-com.alibaba.nacos.client.naming.event.InstancesChangeEvent] INFO o.a.d.r.c.e.l.ServiceInstancesChangedListener -[traceId=N/A]ServiceInstancesChangedListener.java:308- [DUBBO] Received instance no
tification, serviceName: member-service, instances: 1, dubbo version: 3.2.2, current host: 172.22.0.98
2023-06-29 18:09:32.787 [nacos.publisher-com.alibaba.nacos.client.naming.event.InstancesChangeEvent] INFO o.apache.dubbo.rpc.model.ModuleModel -[traceId=N/A]ModuleModel.java:203- [DUBBO] Dynamically registering consumer model member-ser
vice/org.apache.dubbo.metadata.MetadataService:1.0.0 into model Dubbo Module[1.1.0], dubbo version: 3.2.2, current host: 172.22.0.98
2023-06-29 18:09:32.802 [NettyClientWorker-5-8] INFO o.a.d.r.t.netty4.NettyServerHandler -[traceId=N/A]NettyServerHandler.java:75- [DUBBO] The connection of /172.22.0.102:50051 -> /172.22.0.98:56410 is established., dubbo version: 3.2.2
, current host: 172.22.0.98
2023-06-29 18:09:32.802 [NettyClientWorker-5-8] INFO o.a.d.r.t.n.NettyConnectionHandler -[traceId=N/A]NettyConnectionHandler.java:100- [DUBBO] The connection of /172.22.0.98:56410 -> /172.22.0.102:50051 is established., dubbo version: 3
.2.2, current host: 172.22.0.98
2023-06-29 18:09:32.803 [nacos.publisher-com.alibaba.nacos.client.naming.event.InstancesChangeEvent] INFO o.a.d.r.transport.AbstractClient -[traceId=N/A]AbstractClient.java:228- [DUBBO] Successfully connect to server /172.22.0.102:50051
from NettyConnectionClient 172.22.0.98 using dubbo version 3.2.2, channel is NettyChannel [channel=[id: 0xd00daf02, L:/172.22.0.98:56410 - R:/172.22.0.102:50051]], dubbo version: 3.2.2, current host: 172.22.0.98
2023-06-29 18:09:32.803 [nacos.publisher-com.alibaba.nacos.client.naming.event.InstancesChangeEvent] INFO o.a.d.r.transport.AbstractClient -[traceId=N/A]AbstractClient.java:79- [DUBBO] Start NettyConnectionClient /172.22.0.98 connect to
the server /172.22.0.102:50051, dubbo version: 3.2.2, current host: 172.22.0.98
2023-06-29 18:09:33.135 [nacos.publisher-com.alibaba.nacos.client.naming.event.InstancesChangeEvent] INFO o.a.d.r.t.netty4.NettyChannel -[traceId=N/A]NettyChannel.java:253- [DUBBO] Close netty channel [id: 0xd00daf02, L:/172.22.0.98:564
10 - R:/172.22.0.102:50051], dubbo version: 3.2.2, current host: 172.22.0.98
2023-06-29 18:09:33.136 [NettyClientWorker-5-8] INFO o.a.d.r.t.netty4.NettyServerHandler -[traceId=N/A]NettyServerHandler.java:90- [DUBBO] The connection of /172.22.0.102:50051 -> /172.22.0.98:56410 is disconnected., dubbo version: 3.2.
2, current host: 172.22.0.98
2023-06-29 18:09:33.137 [NettyClientWorker-5-8] INFO o.a.d.r.t.n.NettyConnectionHandler -[traceId=N/A]NettyConnectionHandler.java:81- [DUBBO] The client has been closed and will not reconnect. , dubbo version: 3.2.2, current host: 172.2
2.0.98
```
这个是nacos上的服务提供者变更后的ip

Contributor guide
Research direction
Start with the logged paths in NettyConnectionHandler.java around line 81 and AbstractClient.java around lines 79 and 228, then trace the close and reconnect decision after the Nacos provider IP changes. Use the supplied startup log and provider-change scenario to determine why the client is marked closed; done means the cause is identified and the affected reconnect behavior has a regression test or verified fix.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- distributed-systems, networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 32/100