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

r/aws_apigatewayv2: additional ConflictException retry logic #40840

Merged
merged 1 commit into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changelog/40840.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
```release-note:bug
resource/aws_apigatewayv2_route: Fix retry handling of `ConflictException` error responses
```
```release-note:note
provider: The retry handling in the `apigatewayv2` client has been updated to more extensively match `ConflictException` error responses. This change should be transparent to users, but if any unexpected changes in behavior with `apigatewayv2` resources occur following an upgrade to this release, please open a bug report.
```
7 changes: 7 additions & 0 deletions internal/service/apigatewayv2/service_package.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ func (p *servicePackage) NewClient(ctx context.Context, config map[string]any) (
if errs.IsAErrorMessageContains[*awstypes.ConflictException](err, "try again later") {
return aws.TrueTernary
}
// In some instances, ConflictException error responses have been observed as
// a *smithy.OperationError type (not an *awstypes.ConflictException), which
// can't be handled via errs.IsAErrorMessageContains. Instead we fall back
// to a simple match on the message contents.
if errs.Contains(err, "Unable to complete operation due to concurrent modification. Please try again later.") {
return aws.TrueTernary
}
return aws.UnknownTernary // Delegate to configured Retryer.
}))
},
Expand Down
Loading