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

fix(rt): only retry client errors if metadata allows #560

Merged
merged 3 commits into from
Jan 5, 2022
Merged

Conversation

aajtodd
Copy link
Contributor

@aajtodd aajtodd commented Jan 4, 2022

Issue #

fixes #555

Description of changes

Do not retry ClientException unless metadata explicitly allows it. In general client exceptions are a class of exception that aren't retryable (serialization/deserialization errors, state errors, configuration errors, etc)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@aajtodd aajtodd requested a review from a team as a code owner January 4, 2022 17:34
@aajtodd aajtodd requested review from ianbotsf and kggilmer January 4, 2022 17:34
Comment on lines 49 to 53
@Test
fun testClientException() {
fun testNonRetryableClientException() {
val result = test(ClientException())
assertEquals(RetryDirective.RetryError(RetryErrorType.ClientSide), result)
assertEquals(RetryDirective.TerminateAndFail, result)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Missing a new unit test for ClientException that is retryable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I see that now, I thought thats what the other function you commented on was doing but I see now it's not.

fun testClientSideException() {
fun testRetryableClientException() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: Why did this name change? It's not technically testing for a ClientException where isRetryable is true...it's still testing a ServiceException with errorType == ErrorType.Client.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh you're right I made the update here quickly thinking htis was testing a retryable client exception and missed the fact that this is a service side exception with error type of client (confused yet?). I'll update the name to something like testClientErrorType or something.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 5, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@aajtodd aajtodd merged commit 9ea8d82 into main Jan 5, 2022
@aajtodd aajtodd deleted the fix-retry-policy branch January 5, 2022 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Default retry policy always retries client exceptions
3 participants