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

Implement retries on "unknown errors" #39

Open
miparnisari opened this issue Aug 23, 2022 · 1 comment
Open

Implement retries on "unknown errors" #39

miparnisari opened this issue Aug 23, 2022 · 1 comment

Comments

@miparnisari
Copy link

miparnisari commented Aug 23, 2022

See

func (r DaxRetryer) ShouldRetry(req *request.Request) bool {
daxErr := req.Error.(daxError)
codes := daxErr.CodeSequence()
return len(codes) > 0 && (codes[0] == 1 || codes[0] == 2) || req.IsErrorThrottle() || isAuthCRequiredException(codes)
}

It is not clear to me what code this error has:

return awserr.NewRequestFailure(awserr.New(ErrCodeUnknown, e.Message(), nil), e.StatusCode(), e.RequestID())

But from what i'm seeing in my application, which is calling TransactWriteItemsWithContext, DAX is not retrying on this specific error. I think it should.

Or do you recommend us implementing a retrier?

@sumitsa-amazon
Copy link
Contributor

We recommend application level retry in such cases. The rational is that in case of UnknownErrors, DAX client isn't really aware if the changes made it to DDB and can't determine if it is safe to perform retries. The application is expected to perform sanity validations (if required), and attempt a retry.

This behavior is similar to AmbiguousWriteFailureException in DAX Java SDK ref.

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

No branches or pull requests

2 participants