Skip to content

Commit

Permalink
Add a sleep to reduce the likelihood of eventual consistency issue (#…
Browse files Browse the repository at this point in the history
…11044) (#18566)

[upstream:0a5f3df75416c3ae6ac22d4352e535e50155dcbd]

Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored Jun 26, 2024
1 parent 9c088ac commit f2f84b0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .changelog/11044.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
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.
```
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,12 @@ func resourceGoogleServiceAccountKeyCreate(d *schema.ResourceData, meta interfac
if err != nil {
return err
}

// We can't guarantee complete consistency even after waiting on
// the results, so sleep for some additional time to reduce the
// likelihood of eventual consistency failures.
time.Sleep(10 * time.Second)

return resourceGoogleServiceAccountKeyRead(d, meta)
}

Expand Down

0 comments on commit f2f84b0

Please sign in to comment.