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

Need more detailed information about the new spring.cloud.config.retry.useRandomPolicy property #2378

Closed
marnee01 opened this issue Jan 26, 2024 · 2 comments
Milestone

Comments

@marnee01
Copy link
Contributor

Describe the bug
There is a new property, spring.cloud.config.retry.useRandomPolicy that was introduced with 4.0.5. It is documented here:
https://docs.spring.io/spring-cloud-config/reference/client.html#config-client-retry. That documentation should have more details to explain the retry algorithm when useRandomPolicy=true and other retry properties are set:

Is this still honored when useRandomPolicy=true?
spring.cloud.config.retry.max-attempts

Are these ignored when useRandomPolicy=true?

spring.cloud.config.retry.initial-interval
spring.cloud.config.retry.max-interval
spring.cloud.config.retry.multiplier

(Why aren't the retry properties documented in that section?)

@ryanjbaxter
Copy link
Contributor

Here is my reading of how this works based on Spring Retry.

max-attempts is still honored because that is just specifying how many retry attempts will be made.

max-interval and max-multiplier are also used in the generation of the random sleep increment, see https://github.com/spring-projects/spring-retry/blob/main/src/main/java/org/springframework/retry/backoff/ExponentialRandomBackOffPolicy.java#L77

intial-interval is used in the call to super.getSleepAndIncrement in ExponentialRandomBackOffPolicy so yes I believe all are still used.

@marnee01
Copy link
Contributor Author

marnee01 commented Feb 1, 2024

Thank you for the additional information. I actually had also looked at the code and came to the same conclusion.

In the original issue here I had this:

(Why aren't the retry properties documented in that section?)

However, I should have worded it differently and not put it in parentheses. Really that was my main question/issue. I request that the documentation that was added for the new property be updated to include these details (so it's available to all users).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Done
Development

No branches or pull requests

3 participants