Skip to content

stateless retry always throws original exception on exhaustion #40

Closed
@zyro23

Description

@zyro23

this is maybe more a question than a real issue but i would like to know what is the expected behavior.

the readme states that

Simple implementations will just throw RetryExhaustedException which will cause any enclosing transaction to be rolled back

but for a stateless retry, that is not the behavior i am seeing (always original exception thrown).

handleRetryExhausted is invoked correctly, with state being null (ok, i guess, because the retry is stateless). but then, it looks like always the original exception is thrown back to the user, never wrapped in an ExhaustedRetryException. that is because thrown() is not invoked but instead just throw wrapIfNecessary(context.getLastThrowable()); (https://github.com/spring-projects/spring-retry/blob/master/src/main/java/org/springframework/retry/support/RetryTemplate.java#L467)

thanks for clarification!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions