Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add more messages to retry on for monitoring #7631

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/4145.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
monitoring: added more retries for potential failed monitoring operations
```
7 changes: 4 additions & 3 deletions google/error_retry_predicates.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down