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

[IA-1433] Add google IAM retries #272

Merged
merged 2 commits into from
Oct 8, 2019
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -39,11 +39,11 @@ Latest SBT dependency: `"org.broadinstitute.dsde.workbench" %% "workbench-metric

Contains utility functions for talking to Google APIs and DAOs for Google PubSub, Google Directory, Google IAM, and Google BigQuery.

Latest SBT dependency: `"org.broadinstitute.dsde.workbench" %% "workbench-google" % "0.21-52d830c"`
Latest SBT dependency: `"org.broadinstitute.dsde.workbench" %% "workbench-google" % "0.21-TRAVIS-REPLACE-ME"`

To depend on the `MockGoogle*` classes, additionally depend on:

`"org.broadinstitute.dsde.workbench" %% "workbench-google" % "0.21-52d830c" % "test" classifier "tests"`
`"org.broadinstitute.dsde.workbench" %% "workbench-google" % "0.21-TRAVIS-REPLACE-ME" % "test" classifier "tests"`

[Changelog](google/CHANGELOG.md)

Expand Down
2 changes: 1 addition & 1 deletion google/CHANGELOG.md
Expand Up @@ -4,7 +4,7 @@ This file documents changes to the `workbench-google` library, including notes o

## 0.21

SBT dependency: `"org.broadinstitute.dsde.workbench" %% "workbench-google" % "0.20-52d830c"`
SBT dependency: `"org.broadinstitute.dsde.workbench" %% "workbench-google" % "0.20-TRAVIS-REPLACE-ME"`

### Changed

Expand Down
Expand Up @@ -145,7 +145,7 @@ class HttpGoogleIamDAO(appName: String,
private def modifyIamRolesForUser(iamProject: GoogleProject, userEmail: WorkbenchEmail, rolesToAdd: Set[String], rolesToRemove: Set[String]): Future[Boolean] = {
// Note the project here is the one in which we're removing the IAM roles
// Retry 409s here as recommended for concurrent modifications of the IAM policy
retry(when5xx, whenUsageLimited, when404, whenInvalidValueOnBucketCreation, whenNonHttpIOException, when409) { () =>
retry(when5xx, whenUsageLimited, whenGlobalUsageLimited, when404, whenInvalidValueOnBucketCreation, whenNonHttpIOException, when409) { () =>
// it is important that we call getIamPolicy within the same retry block as we call setIamPolicy
// getIamPolicy gets the etag that is used in setIamPolicy, the etag is used to detect concurrent
// modifications and if that happens we need to be sure to get a new etag before retrying setIamPolicy
Expand Down