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

Made AppEngine requests retry if they fail due to a P4SA propagation delay #2922

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/4453.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
appengine: added retry for P4SA propagation delay
```
5 changes: 4 additions & 1 deletion google-beta/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