Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

服务断联一段时间后无法重新注册 #207

Open
yangbocheng opened this issue Jan 20, 2025 · 2 comments
Open

服务断联一段时间后无法重新注册 #207

yangbocheng opened this issue Jan 20, 2025 · 2 comments

Comments

@yangbocheng
Copy link

前置条件

现有3个服务注册。
agile server配置了超时移除服务;aspnetcore 配置了心跳15秒(见后图)

  1. aspnetcore服务的配置
  "AgileConfig": {
    "appId": "app1id",
    "secret": "123456",
    //    "nodes": "http://10.219.25.29:20003",
    "nodes": "http://localhost:12000",
    "name": "auth",
    "tag": "tag1",
    "env": "DEV",
    "serviceRegister": {
      "serviceName": "auth",
      //后台扩展赋值
      "ip": "",
      "port": "",
      "heartbeat": {
        "interval": "15"
      }
    }
  }
  1. agile server的配置
  "alwaysTrustSsl": true, // If true, the server will ignore SSL errors.
  "serviceHealthCheckInterval": 15, // 服务健康检测的间隔时间,单位:秒
  "serviceUnhealthInterval": 60, // 判断服务不健康的间隔,超出这个时间没响应过则认为不健康,默认60,单位:秒
  "removeServiceInterval": 30, // 如果一个服务超出这个时间没有响应,则直接移除这个服务,单位:秒;如果设定为 <= 0,则不会移除,默认 0 。

操作

当其中2个服务逐个处于调试模式(只要断点暂停就可以触发现象),暂停了超过30秒。
此时从agile面板看。 2个服务都在各自调试超过大约30秒后自动下线了。

但是此后,2者都无法自动重连。

Image

Image

想法

1.从直觉上看,如果启用了服务注册,从agile面板上看客户端以及服务2个菜单的数据应该是一致才对吧。现在断线2个服务后,客户端一直维持3个,服务确只有1个。
2.注册中心应该能支持断线重连行为
3.面板上 服务id和客户端id应该设计为一样

@yangbocheng
Copy link
Author

从agile server控制台来看,应该是agile client的问题。
如下将agile server修改配"removeServiceInterval": 0表示不再删除服务,然后重启agile server
可以看见3个服务都重新连上了websocket, 但是只有其中1个服务会重新发送心跳,2个之前因调试断线的服务没有重新发送心跳?

Image

@kklldog
Copy link
Collaborator

kklldog commented Jan 22, 2025

放假了看看

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants