Skip to content

Commit

Permalink
do not retry if sql api returns 409 for deleted instance name
Browse files Browse the repository at this point in the history
  • Loading branch information
megan07 committed Dec 11, 2019
1 parent 9aa86ab commit 7f91485
Showing 1 changed file with 4 additions and 0 deletions.
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 7f91485

Please sign in to comment.