Skip to content

Commit 5fd8133

Browse files
add more messages to retry on for monitoring (#4145) (#2639)
Signed-off-by: Modular Magician <[email protected]>
1 parent 58d1c7e commit 5fd8133

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

.changelog/4145.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:bug
2+
monitoring: added more retries for potential failed monitoring operations
3+
```

google-beta/error_retry_predicates.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,18 +216,19 @@ func isBigqueryIAMQuotaError(err error) (bool, string) {
216216
return false, ""
217217
}
218218

219-
// Retry if Monitoring operation returns a 429 with a specific message for
219+
// Retry if Monitoring operation returns a 409 with a specific message for
220220
// concurrent operations.
221221
func isMonitoringConcurrentEditError(err error) (bool, string) {
222222
if gerr, ok := err.(*googleapi.Error); ok {
223-
if gerr.Code == 409 && strings.Contains(strings.ToLower(gerr.Body), "too many concurrent edits") {
223+
if gerr.Code == 409 && (strings.Contains(strings.ToLower(gerr.Body), "too many concurrent edits") ||
224+
strings.Contains(strings.ToLower(gerr.Body), "could not fulfill the request")) {
224225
return true, "Waiting for other Monitoring changes to finish"
225226
}
226227
}
227228
return false, ""
228229
}
229230

230-
// Retry if App Engine operation returns a 429 with a specific message for
231+
// Retry if App Engine operation returns a 409 with a specific message for
231232
// concurrent operations.
232233
func isAppEngineRetryableError(err error) (bool, string) {
233234
if gerr, ok := err.(*googleapi.Error); ok {

0 commit comments

Comments
 (0)