-
Notifications
You must be signed in to change notification settings - Fork 401
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
当前server实例不在哈希环上时,依旧遍历实例列表 #1203
Closed
Comments
大佬,顺便问下心跳健康检测时间轮添加任务前,delayMilli为什么需要加一个随机数getRandDelayMilli()。是有什么作用吗。
|
getRandDelayMilli 这个方法可以让时间轮上的单位时间执行的任务更分散。 |
实测的时候没发现有能达到散列的作用呀。毫秒级的随机数。时间轮又是每秒一slot,实例的ttl也是int类型。代码里加完之后还是整数。
|
还有一个可能是,当delaySec = 0时,避免AddTask的任务被跳过执行 |
具体要看他们官方给出的结论-_- |
11 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
部分服务端节点被隔离或不健康时,即当前server实例不在哈希环上,依旧会去遍历实例列表。
在心跳分派处理上,可能只希望部分server实例参与心跳健康处理,未参与心跳分派的server实例不需要遍历实例列表。
The text was updated successfully, but these errors were encountered: