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 authored Dec 12, 2019
2 parents f0622d8 + 2d06a01 commit 204438e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions google/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 204438e

Please sign in to comment.