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

gcs-bucket-mover: Fix extra retry caused by unhandled exception #607

Merged
merged 5 commits into from
Feb 15, 2021

Conversation

woitaszek
Copy link
Contributor

Primary fix:

  • Add an explicit type conversion to prevent an unhandled exception in _print_sts_counters caused by comparing str and int. This exception was propagating up the call stack until interception by a @retry decorator, causing a second STS job to be created after the first STS job completed.

Ancillary changes:

  • Add check confirming that source bucket properties could be retrieved at start of program
  • Display bucket names in spinner messages at time of creation

In particular, IAM details are not available at all if IAM is not
enabled as part of the bucket move operation, which may prevent
other features (and in particular the locking file) from working.
The bucket counters are later compared as integers, which now fails with:
    An exception occured... '>' not supported between instances of 'str' and 'int'

and the exception triggers the upstream retry loop.
@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines. label Jan 30, 2021
@google-cla google-cla bot added the cla: yes All committers have signed a CLA label Jan 30, 2021
Copy link
Contributor

@eshen1991 eshen1991 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

Copy link
Member

@iht iht left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@iht iht merged commit e058890 into GoogleCloudPlatform:main Feb 15, 2021
rosmo pushed a commit to rosmo/professional-services that referenced this pull request Mar 17, 2022
…leCloudPlatform#607)

gcs-bucket-mover: 

* Fail when run on buckets that do not exist
* Comment bucket parameter availability
* Display name of bucket being created
* Cast transfer counters to int
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes All committers have signed a CLA size/M Denotes a PR that changes 30-99 lines.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants