You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2021/09/24 03:06:09 UTC

[GitHub] [dubbo] hetianyi opened a new issue #8902: Service cannot be re-registered after it was deregistered by consul (Consul的服务被剔除无法重新注册问题)

hetianyi opened a new issue #8902:
URL: https://github.com/apache/dubbo/issues/8902


   - [x] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate.
   - [x] I have checked the [FAQ](https://github.com/apache/dubbo/blob/master/FAQ.md) of this repository and believe that this is not a duplicate.
   
   ### Environment
   
   * Dubbo version: 2.7.13
   * Operating System version: Windows 10
   * Java version: 1.8
   
   ### Steps to reproduce this issue
   
   1. Start consul(standalone)  本地以standalone启动consul
   ```shell
   consul.exe agent -server -ui -client=0.0.0.0 -data-dir=./data -node=local-dev -bootstrap-expect=1 -bind=0.0.0.0 -advertise=10.1.199.10
   ```
   ```10.1.199.10``` is your local machine IP address.
   
   假定你当前的IP地址是```10.1.199.10```
   
   2. Start dubbo provider(a springboot application), service name is ```com.xxx.Service1```.
   dubbo registry address must be: ```consul://10.1.199.10:8500```
   In consul web ui, service status ```com.xxx.Service1``` is ok.
   
   启动dubbo provider,是一个springboot应用,假设服务名是```com.xxx.Service1```,dubbo的注册地址是```consul://10.1.199.10:8500```,在consul的web控制台中观察服务```consul://10.1.199.10:8500```的状态正常。
   
   
   3. Switch to another wifi, your IP address will change, and wait consul to deregister service ```com.xxx.Service1```.
   **This is to imitate the abnormal situation of network disconnection**
   
   切换到其他WIFI,你的IP地址会变化(这个过程模拟网络连接异常情况),consul会在几分钟之后将服务```com.xxx.Service1```剔除。
   
   
   4. Switch to the last wifi you connected, your IP addresss turns back to ```10.1.199.10```, but service ```com.xxx.Service1``` will never re-register again, and the springboot keeps print error: 
   ```txt
   2021-09-24 10:43:13,212 WARN  org.apache.dubbo.registry.consul.ConsulRegistry:232 -  [DUBBO] fail to check pass for url: dubbo://10.1.199.10:20080/com.xxx.Service1?application=xxx&deprecated=false&dubbo=2.0.2&release=2.7.13&serialization=kryo&timestamp=1632450634959, check id is: a8fcf2ef, dubbo version: 2.7.13, current host: 192.168.189.1
   com.ecwid.consul.v1.OperationException: OperationException(statusCode=500, statusMessage='Internal Server Error', statusContent='CheckID "service:a8fcf2ef" does not have associated TTL')
   	at com.ecwid.consul.v1.agent.AgentConsulClient.agentCheckPass(AgentConsulClient.java:211)
   	at com.ecwid.consul.v1.agent.AgentConsulClient.agentCheckPass(AgentConsulClient.java:198)
   	at com.ecwid.consul.v1.agent.AgentConsulClient.agentCheckPass(AgentConsulClient.java:193)
   	at com.ecwid.consul.v1.ConsulClient.agentCheckPass(ConsulClient.java:260)
   	at org.apache.dubbo.registry.consul.ConsulRegistry.checkPass(ConsulRegistry.java:224)
   	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
   	at java.util.concurrent.FutureTask.runAndReset$$$capture(FutureTask.java:308)
   	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java)
   	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
   	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
   	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
   	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
   	at java.lang.Thread.run(Thread.java:748)
   ```
   
   再次将WIFI切换回原来的WIFI(模拟网络恢复正常),服务 ```com.xxx.Service1```无法自动重新注册。
   
   Pls. provide [GitHub address] to reproduce this issue.
   
   ### Expected Result
   
   I think the correct way is what spring cloud consul does:
   
   我认为正确的处理方式是spring cloud consul官方的处理方式
   
   https://github.com/spring-cloud/spring-cloud-consul/blob/90b9eee41e5916ba999b25432fe44e1ca4362e2f/spring-cloud-consul-discovery/src/main/java/org/springframework/cloud/consul/discovery/TtlScheduler.java#L118
   
   
   
   ### Actual Result
   
   What actually happens?
   
   If there is an exception, please attach the exception trace:
   
   ```
   Just put your stack trace  #here!
   ```
   


-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org