-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Description
Which Component
LoadBalancer
Describe the bug
After upgrading from version 2021.0.5 to 2021.0.6.2, during RPC calls, the system no longer prioritizes services within the current cluster for RPC invocation.
I have two clusters: yun and local:
When spring.cloud.loadbalancer.nacos.enabled=true is configured in the configuration file,
in version 2021.0.5.0 of spring-cloud-alibaba-dependencies, during RPC calls, the method com.alibaba.cloud.nacos.loadbalancer.NacosLoadBalancer#getInstanceResponse will be used to prioritize returning instances that match the current cluster name.
However, in version 2021.0.6.2 of spring-cloud-alibaba-dependencies, this method is no longer invoked. I only know that now incorrect cluster instances are being used, causing RPC exceptions:
feign.RetryableException: Connect to 192.168.0.11:9830 [/192.168.0.11] failed: connect timed out executing POST http://service-resource/resource/classroom/listStuCourseInfo
at feign.FeignException.errorExecuting(FeignException.java:268)
at feign.SynchronousMethodHandler.executeAndDecode(SynchronousMethodHandler.java:131)
at feign.SynchronousMethodHandler.invoke(SynchronousMethodHandler.java:91)
at feign.ReflectiveFeign$FeignInvocationHandler.invoke(ReflectiveFeign.java:100)
Simplest demo
Expected behavior
Continue to follow the load balancing logic of version 2021.0.5, prioritizing the return of instances that match the current cluster name.
Additional context
spring-cloud-alibaba-dependencies 2021.0.6.2
spring-cloud-dependencies 2021.0.5
spring-boot-starter-parent 2.7.13
java 1.8