Skip to content

Commit

Permalink
do not retry if sql api returns 409 for deleted instance name (#2817)
Browse files Browse the repository at this point in the history
Merged PR #2817.
  • Loading branch information
megan07 authored and modular-magician committed Dec 12, 2019
1 parent 90e4409 commit f206d90
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build/ansible
2 changes: 1 addition & 1 deletion build/inspec
Submodule inspec updated 1 files
+1 −1 Gemfile
2 changes: 1 addition & 1 deletion build/terraform
2 changes: 1 addition & 1 deletion build/terraform-beta
4 changes: 4 additions & 0 deletions third_party/terraform/utils/error_retry_predicates.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ func pubsubTopicProjectNotReady(err error) (bool, string) {

func isSqlOperationInProgressError(err error) (bool, string) {
if gerr, ok := err.(*googleapi.Error); ok && gerr.Code == 409 {
if strings.Contains(gerr.Body, "you cannot reuse the name of the deleted instance until one week from the deletion date.") {
return false, ""
}

return true, "Waiting for other concurrent Cloud SQL operations to finish"
}
return false, ""
Expand Down

0 comments on commit f206d90

Please sign in to comment.