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?)
Comment From: ryanjbaxter
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.
Comment From: marnee01
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).