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

@Retryable - Support Rethrow Instead of ExhaustedRetryException #264

Closed
garyrussell opened this issue Jan 26, 2022 · 2 comments · Fixed by #309
Closed

@Retryable - Support Rethrow Instead of ExhaustedRetryException #264

garyrussell opened this issue Jan 26, 2022 · 2 comments · Fixed by #309

Comments

@garyrussell
Copy link
Contributor

See #263 (comment)

ttulka added a commit to ttulka/spring-retry that referenced this issue Jan 26, 2022
ttulka added a commit to ttulka/spring-retry that referenced this issue Jan 26, 2022
ttulka added a commit to ttulka/spring-retry that referenced this issue Jan 26, 2022
ttulka added a commit to ttulka/spring-retry that referenced this issue Jan 26, 2022
ttulka added a commit to ttulka/spring-retry that referenced this issue Jan 27, 2022
ttulka added a commit to ttulka/spring-retry that referenced this issue Apr 1, 2022
ttulka added a commit to ttulka/spring-retry that referenced this issue Apr 1, 2022
ttulka added a commit to ttulka/spring-retry that referenced this issue Apr 12, 2022
garyrussell added a commit that referenced this issue Apr 12, 2022
garyrussell added a commit that referenced this issue Apr 14, 2022
garyrussell added a commit that referenced this issue Apr 14, 2022
@garyrussell garyrussell added this to the 2.0.0-M1 milestone Apr 14, 2022
@garyrussell garyrussell reopened this Apr 14, 2022
@garyrussell
Copy link
Contributor Author

I propose the following as a straw man:

Add

@AliasFor("include") Class<? extends Throwable>[] retryFor()

@AliasFor("exclude") Class<? extends Throwable>[] noRetryFor()

Class<? extends Throwable>[] noRetryNoRecoveryFor()

All others not specified are not retriable, but go straight to recovery.

No rethrow attribute.

@artembilan
Copy link
Member

Sounds like a plan.
Although if retryFor() is empty, it it is going to be "retry-n-recovery", like the current behavior:

boolean retryNotExcluded = includes.length == 0;

which goes to the defaultValue of the SimpleRetryPolicy.

I guess we can set a new RetryContext.NO_RECOVERY attribute in the SimpleRetryPolicy for the noRetryNoRecoveryFor to avoid polluting RetryTemplate API...
The null value for those exceptions should be OK in the Map<Class<? extends Throwable>, Boolean> retryableExceptions as an indicator for a third state.

@garyrussell garyrussell self-assigned this Sep 12, 2022
garyrussell added a commit to garyrussell/spring-retry that referenced this issue Sep 12, 2022
garyrussell added a commit to garyrussell/spring-retry that referenced this issue Sep 12, 2022
artembilan pushed a commit that referenced this issue Sep 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants