-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[Feature request]: allow MaxRetryAttempts=0 #2297
Comments
I would argue allowing this could have the opposite effect of allowing you to accidentally configure a non-functional retry policy while still paying for the performance overhead of a retry that will never actually retry. I think the change for v8 makes more overall sense (retrying 0 times isn't a retry), so the correct thing to do is your "workaround" of not adding a policy that doesn't make any sense in the first place. Either way has an advantage and a disadvantage, and I think making mis-configuration apparent/obvious is better than silent failure (i.e. no retries). |
Yeah I'm fine with that idea. Just wanted to open the discussion because I'm pretty sure we'll have an incident in the future where a retry config is set to 0. |
I'm glad you test your policies though 😄 I've always maintained people should configure their policies and then test they behave the way they think they've configured them is correct. |
I too would like to see zero attempts allowed and interpreted as effectively disabling the strategy. Consider that application topology differs from application configuration. When I build a resilience pipeline, certain assumptions are codified and are less easily changed (viz. what strategies exist and in what order they execute). On the other hand, given the options pattern, the pipeline supports a number of different possible configurations. Whether or not a given strategy is enabled should be a matter of configuration IMO and should not require changes to the topology of the pipeline. |
Is your feature request related to a specific problem? Or an existing feature?
I'm migrating from policies to resilience pipelines and I saw many of my tests failing because of
It seems like 0 is not accepted anymore.
The work around is to do
but it's kind of easy to miss.
In my case, the
MaxRetryAttempts
can come from dynamic configurations. So, changing a config to disable the pipeline by setting 0 to MaxRetryAttemps could actually break the application.Describe the solution you'd like
When MaxRetryAttemps is set to 0, it would simply disable the retry.
Additional context
No response
The text was updated successfully, but these errors were encountered: