From 2d06a01345e932803ed716f956741e1f657a9935 Mon Sep 17 00:00:00 2001 From: megan07 Date: Wed, 11 Dec 2019 18:30:18 +0000 Subject: [PATCH] do not retry if sql api returns 409 for deleted instance name Signed-off-by: Modular Magician --- google/error_retry_predicates.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/google/error_retry_predicates.go b/google/error_retry_predicates.go index d02614392a9..c5d02726fc4 100644 --- a/google/error_retry_predicates.go +++ b/google/error_retry_predicates.go @@ -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, ""