Skip to content

Commit f2f84b0

Browse files
Add a sleep to reduce the likelihood of eventual consistency issue (#11044) (#18566)
[upstream:0a5f3df75416c3ae6ac22d4352e535e50155dcbd] Signed-off-by: Modular Magician <[email protected]>
1 parent 9c088ac commit f2f84b0

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

.changelog/11044.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:bug
2+
resourcemanager: added a 10s wait after `google_service_account_key` creation to attempt to mitigate eventual concistency issues resulting in a `Root resource was present, but now absent` error.
3+
```

google/services/resourcemanager/resource_google_service_account_key.go

+6
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,12 @@ func resourceGoogleServiceAccountKeyCreate(d *schema.ResourceData, meta interfac
147147
if err != nil {
148148
return err
149149
}
150+
151+
// We can't guarantee complete consistency even after waiting on
152+
// the results, so sleep for some additional time to reduce the
153+
// likelihood of eventual consistency failures.
154+
time.Sleep(10 * time.Second)
155+
150156
return resourceGoogleServiceAccountKeyRead(d, meta)
151157
}
152158

0 commit comments

Comments
 (0)