-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
RequestSpecificRetryHandler retries same server for SERVER_THROTTLED #2585
Comments
Hi @brenuart |
Ribbon can indeed be configured to retry the same server a couple of times before trying the next one.
The second call is useless... |
@brenuart |
Is there a "server throttled" status code? I cant seem to find any information on it, besides its use in Ribbon. |
It is indeed a Netflix/Ribbon specific feature that is hardcoded in their RestClient. The client returns When
We used to override that implementation to check the |
So this is only when using the Ribbon rest client then, correct? |
AFAIK yes. |
Feel free to submit a PR for this. If not it will be a low priority item for us since the Netflix Rest Client is deprecated. |
I understand it is becoming low priority since the move to Spring Retry. However some of us are currently stuck on using Netflix's RestClient until they are able to move to more recent clients. It is actually our case for the moment mainly because of the following reasons:
I'll be more than happy to submit the PR and help people in the same situation as us. If you don't mind, we'll keep posting (so-called) issues if we believe it can help others, even if RestClient is deprecated. Is that ok for you? |
That is perfectly fine. We are always willing to accept any kind of contribution. |
spring-cloud#2585: Override RequestSpecificRetryHandler to first handle ClientException.ErrorType.SERVER_THROTTLED type of error and respond to not retry on the same server. Delegate to legacy behavior in other cases. spring-cloud#2586: Add “java.net.UnknownHostException” to the list of connection related issues
Netflix's
RequestSpecificRetryHandler
allows to retry on same server forSERVER_THROTTLED
error.When the
okToRetryOnAllErrors
property istrue
, the retry handler allows to retry on the same server unconditionally without taking into account the actual error. This is useless when the server responded with SERVER_THROTTLED.It looks like the if statement at https://github.com/Netflix/ribbon/blob/master/ribbon-core/src/main/java/com/netflix/client/RequestSpecificRetryHandler.java#L58-L65 should be considered first before the other conditions.
I doubt Netflix is willing to change this behavior but we could override it in SpringCloud.
What do you think ?
The text was updated successfully, but these errors were encountered: