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: apigatewayv2 error handling for ConflictException: Unable to complete operation due to concurrent modification. #29735

Merged
merged 4 commits into from
Mar 10, 2023
Merged
Changes from 1 commit
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
11 changes: 11 additions & 0 deletions internal/conns/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/aws/aws-sdk-go/aws/endpoints"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/service/apigateway"
"github.com/aws/aws-sdk-go/service/apigatewayv2"
"github.com/aws/aws-sdk-go/service/appconfig"
"github.com/aws/aws-sdk-go/service/applicationautoscaling"
"github.com/aws/aws-sdk-go/service/appsync"
Expand Down Expand Up @@ -266,6 +267,16 @@ func (c *Config) ConfigureProvider(ctx context.Context, client *AWSClient) (*AWS
r.Retryable = aws.Bool(true)
}
})

//Potential fix for https://github.com/hashicorp/terraform-provider-aws/issues/18018
client.apigatewayv2Conn.Handlers.Retry.PushBack(func(r *request.Request) {
// Many operations can return an error such as:
// ConflictException: Unable to complete operation due to concurrent modification. Please try again later.
// Handle them all globally for the service client.
if tfawserr.ErrMessageContains(r.Error, apigatewayv2.ErrCodeConflictException, "try again later") {
r.Retryable = aws.Bool(true)
}
})

// Workaround for https://github.com/aws/aws-sdk-go/issues/1472
client.applicationautoscalingConn.Handlers.Retry.PushBack(func(r *request.Request) {
Expand Down