-
Notifications
You must be signed in to change notification settings - Fork 706
Enhance RoundRoubinLoadBalancer position #747
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
Comments
Well, I found that the result is retrived through:
this is assined to another thread in reactor, therefore the threadlocal position is not good enough. Consider usinf context to keep origin call context |
one solution is that:
|
A few issues. The number of instances is low these algorithms work much better with higher numbers of instances. Can you increase the retry count? |
@spencergibb increase the retry count will cause the service enter circuit breaker on more often and increase the possibility of avalanche which is not preferred. Moreover, the more the number of threads, the more possibility of retrying same instance |
A further solution is to create a random position for each request Id (when including sleuth, it should be traceId). Ensure the position is separated by request Id and retry will not be executed on same instance before |
@HashZhang That's a good point. We are now working on adding retry support and we'll probably be adding a similar solution there. |
Closing in favour of #659 |
Actually, this will be useful for both blocking and non-blocking retries, so will keep it as a separate issue after all. |
Uh oh!
There was an error while loading. Please reload this page.
Is your feature request related to a problem? Please describe.
Assume there are retries for a rpc call to a remote service, and the retry scheme is retry twice for a call. Assume there are two instances (instance A and instance B) for this service. We want the retry is made twice and each time to a different instance.
But there is a problem while using the
RoundRobinLoadBalancer
. The position is a Atomic field shared across threads and there would be a case that the retry is made to the same instance to the last time:Describe the solution you'd like
Make the position a thread local field and each initialize with random value:
The text was updated successfully, but these errors were encountered: