From 1b79c4aa3b3a4a39a139d4494dc05e89e7461706 Mon Sep 17 00:00:00 2001 From: Modular Magician Date: Mon, 26 Oct 2020 18:39:13 +0000 Subject: [PATCH] add more messages to retry on for monitoring (#4145) Signed-off-by: Modular Magician --- .changelog/4145.txt | 3 +++ google/error_retry_predicates.go | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 .changelog/4145.txt diff --git a/.changelog/4145.txt b/.changelog/4145.txt new file mode 100644 index 00000000000..8e9593d46ea --- /dev/null +++ b/.changelog/4145.txt @@ -0,0 +1,3 @@ +```release-note:bug +monitoring: added more retries for potential failed monitoring operations +``` diff --git a/google/error_retry_predicates.go b/google/error_retry_predicates.go index e981656e241..66c66443974 100644 --- a/google/error_retry_predicates.go +++ b/google/error_retry_predicates.go @@ -216,18 +216,19 @@ func isBigqueryIAMQuotaError(err error) (bool, string) { return false, "" } -// Retry if Monitoring operation returns a 429 with a specific message for +// Retry if Monitoring operation returns a 409 with a specific message for // concurrent operations. func isMonitoringConcurrentEditError(err error) (bool, string) { if gerr, ok := err.(*googleapi.Error); ok { - if gerr.Code == 409 && strings.Contains(strings.ToLower(gerr.Body), "too many concurrent edits") { + if gerr.Code == 409 && (strings.Contains(strings.ToLower(gerr.Body), "too many concurrent edits") || + strings.Contains(strings.ToLower(gerr.Body), "could not fulfill the request")) { return true, "Waiting for other Monitoring changes to finish" } } return false, "" } -// Retry if App Engine operation returns a 429 with a specific message for +// Retry if App Engine operation returns a 409 with a specific message for // concurrent operations. func isAppEngineRetryableError(err error) (bool, string) { if gerr, ok := err.(*googleapi.Error); ok {