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_glue_trigger: handle concurrent modification exceptions #34530

Merged
merged 1 commit into from
Nov 22, 2023
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
3 changes: 3 additions & 0 deletions .changelog/34530.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
resource/aws_glue_trigger: Fix `ConcurrentModificationException: Workflow <workflowName> was modified while adding trigger <triggerName>` errors
```
6 changes: 6 additions & 0 deletions internal/service/glue/trigger.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,13 +258,19 @@ func resourceTriggerCreate(ctx context.Context, d *schema.ResourceData, meta int
if v, ok := d.GetOk("start_on_creation"); ok {
input.StartOnCreation = aws.Bool(v.(bool))
}

log.Printf("[DEBUG] Creating Glue Trigger: %s", input)
err := retry.RetryContext(ctx, propagationTimeout, func() *retry.RetryError {
_, err := conn.CreateTriggerWithContext(ctx, input)
if err != nil {
// Retry IAM propagation errors
if tfawserr.ErrMessageContains(err, glue.ErrCodeInvalidInputException, "Service is unable to assume provided role") {
return retry.RetryableError(err)
}
// Retry concurrent workflow modification errors
if tfawserr.ErrMessageContains(err, glue.ErrCodeConcurrentModificationException, "was modified while adding trigger") {
return retry.RetryableError(err)
}

return retry.NonRetryableError(err)
}
Expand Down
Loading