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

When the client requests the cluster several times in a short time, it will get the same server address. #9615

Closed
chengyj1986xxx opened this issue Nov 21, 2022 · 0 comments
Labels
area/Client Related to Nacos Client SDK kind/enhancement Category issues or prs related to enhancement.
Milestone

Comments

@chengyj1986xxx
Copy link
Contributor

Describe the bug
When the client requests the cluster several times in a short time, it will get the same server address.
当客户端短时间内多次请求集群,会得到同一个服务器地址。

Expected behavior
When the client requests the cluster several times in a short time, it should get different server addresses randomly to achieve load balancing of the cluster.
当客户端短时间内多次请求集群,应当随机得到不同的服务器地址,以期实现集群的负载均衡。

Actually behavior
When the client requests the cluster several times in a short time, it actually gets the same server address, or several duplicate server addresses.
当客户端短时间内多次请求集群,实际上获得了同一个服务器地址,或者重复的几个服务器地址。

How to Reproduce
I'm added a method named testReqApi4 in NamingHttpClientProxyTest.java, which is obtained by modifying testReqApi3. It only modifies the last part of testReqApi3 to change the size of variable servers.
我在NamingHttpClientProxyTest.java中添加了testReqApi4方法,这个方法通过修改testReqApi3得来,只是修改了testReqApi3的最后部分,把变量servers改成多个server。
image
The execution result is as follows, and the same server is got.
执行结果如下,获得了同一个server。
image

Desktop (please complete the following information):

  • OS: [e.g. Centos]
  • Version [e.g. nacos-server 1.3.1, nacos-client 1.3.1]
  • Module [e.g. naming/config]
  • SDK [e.g. original, spring-cloud-alibaba-nacos, dubbo]

Additional context
Add any other context about the problem here.

@KomachiSion KomachiSion added area/Client Related to Nacos Client SDK kind/enhancement Category issues or prs related to enhancement. labels Nov 22, 2022
@KomachiSion KomachiSion added this to the 2.2.0 milestone Nov 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/Client Related to Nacos Client SDK kind/enhancement Category issues or prs related to enhancement.
Projects
None yet
Development

No branches or pull requests

2 participants