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

Rework Exception-wrapping #82

Closed
jbspeakr opened this issue Jun 27, 2017 · 2 comments
Closed

Rework Exception-wrapping #82

jbspeakr opened this issue Jun 27, 2017 · 2 comments
Assignees
Milestone

Comments

@jbspeakr
Copy link

jbspeakr commented Jun 27, 2017

Currently, @CircuitBreaker always wraps failures into into an ExhaustedRetryException. This hides the true nature of the failure and makes it furthermore impossible to figure out whether the circuit breaker is actually open or not.

Having e.g. a @Recover-method just to unwrap and rethrow exceptions seems not a proper way to go... it also doesn't solve the circuit breaker status issue.

The only currently available alternative is to implement a custom circuit breaker RetryTemplate which feels odd.

Please fix.

@jbspeakr jbspeakr changed the title Make Exception-wrapping configurable Rework Exception-wrapping Jun 27, 2017
@dsyer
Copy link
Member

dsyer commented Dec 12, 2017

It's not really a @CircuitBreaker feature is it (the RetryTemplate always wraps the last failed exception)?
It has been like that since the beginning, and therefore there might be reasons and also people relying on the behaviour, so "please fix" is kind of irresponsible. If you have a concrete suggestion about how to evolve the code please feel free to comment or send patches.

@getupdown
Copy link

@dsyer
Hi, dsyer
About the issue, I make a pull request #133 .
I add an option on the @Retryable to decide whether the original exception will be thrown .
Please review, thanks!

@artembilan artembilan added this to the 2.0.6 milestone May 10, 2024
@artembilan artembilan self-assigned this May 10, 2024
natedanner pushed a commit to natedanner/spring-projects__spring-retry that referenced this issue May 20, 2024
…austed()`

Fixes: spring-projects#82

There are some use-cases when `ExhaustedRetryException` does not fit into the logic around Circuit Breaker pattern.

The `RetryTemplate` has already a `throwLastExceptionOnExhausted` flag for stateful retries

* Expose `@CircuitBreaker.throwLastExceptionOnExhausted()` and propagate it down to the `RetryTemplate`
in the `AnnotationAwareRetryOperationsInterceptor`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants