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
Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
megan07 authored and modular-magician committed Dec 11, 2019
1 parent b536fe6 commit 2d06a01
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 2d06a01

Please sign in to comment.