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
The interval at which the heartbeat is sent in BeatReactor is not controlled by the server return value. #768
Comments
The interval at which the heartbeat is sent in BeatReactor is not controlled by the server return value.Recently, I am looking at the Nacos source. As of the current master branch, in the implementation of the
I understand that the design goal is to adjust the frequency at which the client sends heartbeats based on the heartbeat interval returned by the server, but in the constructor of
So the result is that regardless of the value of the |
@darkness463 |
@i will solve it@ |
[ISSUE #768] Fix: client beat interval is not controlled by server.
@darkness463 Thank you very much, your commit has been accepted. |
* [#840] Nacos server adds startup mode to distinguish between config and naming. * [#762] Register instance returns failed when the health check mode is 'server' in standalone mode. * [#473] Nacos Cluster Mode kubernate Startup nacos.log error Log. * [#240] Log strong dependence problem. * [#824] getServicesOfServer throws exception if service list is empty. * [#802] Nacos server multi-boot mode support. * [#800] Nacos's client-to-server addressing mode document introduction. * [#768] The interval at which the heartbeat is sent in BeatReactor is not controlled by the server return value. * [#759] why instance can't auto-delete. * [#756] Format of instance and service should be validated. * [#720] Memory leak in PushService. * [#653] IoUtils under nacos-common-0.2.1-RC1.jar lacks "" judgment on encoding. * [#588] Client compatible to jdk1.6. On branch develop
最近在看Nacos源码,截止目前的master分支,在
com.alibaba.nacos.client.naming.beat.BeatReactor
类的实现中,默认启动时会以5秒一次的频率发送心跳,BeatProcessor
会对dom2Beat
中的每个值创建BeatTask
发送心跳,在BeatTask
中会接收服务端返回的clientBeatInterval
字段并设置给BeatReactor
类中的clientBeatInterval
。关键代码如下:我理解设计目的是根据服务端返回的心跳间隔来调整客户端发送心跳的频率,但在
BeatReactor
的构造函数中,BeatProcessor
是用以下代码启动的:所以导致的结果是,不管服务端返回的
clientBeatInterval
值是多少,客户端都只会以5秒的间隔发送心跳,返回值对心跳任务没有任何影响。是bug还是我理解有问题?The text was updated successfully, but these errors were encountered: