Skip to content

Commit

Permalink
Made AppEngine requests retry if they fail due to a P4SA propagation …
Browse files Browse the repository at this point in the history
  • Loading branch information
melinath committed Feb 1, 2021
1 parent 0b23f72 commit f8332e3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mmv1/third_party/terraform/utils/error_retry_predicates.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,12 +240,15 @@ func isNotFilestoreQuotaError(err error) (bool, string) {
}

// Retry if App Engine operation returns a 409 with a specific message for
// concurrent operations.
// concurrent operations, or a 404 indicating p4sa has not yet propagated.
func isAppEngineRetryableError(err error) (bool, string) {
if gerr, ok := err.(*googleapi.Error); ok {
if gerr.Code == 409 && strings.Contains(strings.ToLower(gerr.Body), "operation is already in progress") {
return true, "Waiting for other concurrent App Engine changes to finish"
}
if gerr.Code == 404 && strings.Contains(strings.ToLower(gerr.Body), "unable to retrieve P4SA") {
return true, "Waiting for P4SA propagation to GAIA"
}
}
return false, ""
}
Expand Down

0 comments on commit f8332e3

Please sign in to comment.