Skip to content

Commit a0b3dc6

Browse files
Made AppEngine requests retry if they fail due to a P4SA propagation delay. (#4453) (#2922)
Fixed hashicorp/terraform-provider-google#8333 Signed-off-by: Modular Magician <[email protected]>
1 parent 89cb0fa commit a0b3dc6

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.changelog/4453.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:bug
2+
appengine: added retry for P4SA propagation delay
3+
```

google-beta/error_retry_predicates.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,12 +240,15 @@ func isNotFilestoreQuotaError(err error) (bool, string) {
240240
}
241241

242242
// Retry if App Engine operation returns a 409 with a specific message for
243-
// concurrent operations.
243+
// concurrent operations, or a 404 indicating p4sa has not yet propagated.
244244
func isAppEngineRetryableError(err error) (bool, string) {
245245
if gerr, ok := err.(*googleapi.Error); ok {
246246
if gerr.Code == 409 && strings.Contains(strings.ToLower(gerr.Body), "operation is already in progress") {
247247
return true, "Waiting for other concurrent App Engine changes to finish"
248248
}
249+
if gerr.Code == 404 && strings.Contains(strings.ToLower(gerr.Body), "unable to retrieve P4SA") {
250+
return true, "Waiting for P4SA propagation to GAIA"
251+
}
249252
}
250253
return false, ""
251254
}

0 commit comments

Comments
 (0)