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

add retry to disable project services, update serviceUsageServiceBeingActivated #4098

Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ func disableServiceUsageProjectService(service, project string, d *schema.Resour
return waitErr
}
return nil
}, d.Timeout(schema.TimeoutDelete))
}, d.Timeout(schema.TimeoutDelete), serviceUsageServiceBeingActivated)
if err != nil {
return fmt.Errorf("Error disabling service %q for project %q: %v", service, project, err)
}
Expand Down
4 changes: 2 additions & 2 deletions third_party/terraform/utils/error_retry_predicates.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,10 @@ func isSqlOperationInProgressError(err error) (bool, string) {
func serviceUsageServiceBeingActivated(err error) (bool, string) {
if gerr, ok := err.(*googleapi.Error); ok && gerr.Code == 400 {
if strings.Contains(gerr.Body, "Another activation or deactivation is in progress") {
return false, ""
return true, "Waiting for same service activation/deactivation to finish"
}

return true, "Waiting for same service activation/deactivation to finish"
return false, ""
}
return false, ""
}
Expand Down