GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: make retry parameter public and added in other methods by HemangChothani · Pull Request #331 · googleapis/python-storage

This repository was archived by the owner on Mar 31, 2026. It is now read-only.

Conversation

@HemangChothani

@HemangChothani HemangChothani commented Dec 1, 2020

Copy link
Copy Markdown
Contributor

Fixes #315

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
HemangChothani added 2 commits December 1, 2020 17:48
@HemangChothani
feat: make retry parameter public and added in other methods
d0af8e3
@HemangChothani
feat: resolve conflict
4424b59
@HemangChothani
HemangChothani requested review from frankyn and tseaver December 1, 2020 12:26
@product-auto-label product-auto-label Bot added the api: storage Issues related to the googleapis/python-storage API. label Dec 1, 2020
@google-cla google-cla Bot added the cla: yes This human has signed the Contributor License Agreement. label Dec 1, 2020
@frankyn
frankyn requested review from andrewsg and removed request for frankyn December 1, 2020 19:55
@andrewsg

andrewsg commented Dec 1, 2020

Copy link
Copy Markdown
Contributor

Thanks! This is a major change to the UI in line with our medium-term plan for retry support, so I (author of underlying retry logic) will review thoroughly soon.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

andrewsg
andrewsg suggested changes Dec 2, 2020
View reviewed changes
Comment thread google/cloud/storage/_helpers.py Outdated
blob's current metageneration does not match the given value.

:type retry: google.api_core.retry.Retry
:param retry: (Optional) How to retry the RPC.

@andrewsg andrewsg Dec 2, 2020

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

In order for users to use this, they'll need an explanation of what kinds of objects to pass in and how to modify them. "See retry.py" might be enough if retry.py's comments and docstrings are comprehensive.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread google/cloud/storage/acl.py Outdated
return client

def reload(self, client=None, timeout=_DEFAULT_TIMEOUT):
def reload(self, client=None, timeout=_DEFAULT_TIMEOUT, retry=DEFAULT_RETRY):

@andrewsg andrewsg Dec 2, 2020

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Here in the ACL file you're not just exposing retries in the function signature but actually adding a new default, right? @frankyn ACL commands aren't in the consolidated retry strategy doc, do we want retries enabled on them?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@frankyn frankyn Dec 4, 2020

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

ACLs don't have optimistic concurrency control, therefore we would need to update implementation to rely on storage.objects.patch and storage.buckets.patch instead of ACL specific APIs.

Let's remove ACL retries from this PR for now and open a tracking issue.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
HemangChothani added 2 commits December 3, 2020 18:42
@HemangChothani
feat: change in doc string
674b0f2
@HemangChothani
Merge branch 'master' of https://github.com/googleapis/python-storage …
3d36abb
…into storage_issue_315
@HemangChothani
HemangChothani requested a review from a team December 3, 2020 13:12
andrewsg
andrewsg suggested changes Dec 3, 2020
View reviewed changes
Comment thread google/cloud/storage/_helpers.py Outdated
@@ -190,7 +190,9 @@ def reload(
blob's current metageneration does not match the given value.

:type retry: google.api_core.retry.Retry

@andrewsg andrewsg Dec 3, 2020

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Technically either google.api_core.retry.Retry or google.cloud.storage.retry.ConditionalRetryPolicy are supported here, and in some cases ConditionalRetryPolicy is the default so despite the complexity we should document it here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread google/cloud/storage/_helpers.py Outdated
:param retry: (Optional) How to retry the RPC.
:param retry: (Optional) How to retry the RPC. To modify the default retry behavior,
create a new retry object modeled after this one by calling it a ``with_XXX`` method.
See: https://googleapis.dev/python/google-api-core/latest/retry.html for details.

@andrewsg andrewsg Dec 3, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

(Optional) How to retry the RPC. A None value will disable retries. A google.api_core.retry.Retry value will enable retries, and the object will define retriable response codes and errors and configure backoff and timeout options.

A google.cloud.storage.retry.ConditionalRetryPolicy value wraps a Retry object and activates it only if certain conditions are met. This class exists to provide safe defaults for RPC calls that are not technically safe to retry normally (due to potential data duplication or other side-effects) but become safe to retry if a condition such as if_metageneration_match is set.

See the retry.py source code and docstrings in this package (google.cloud.storage.retry) for information on retry types and how to configure them.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@HemangChothani
feat: changes in docstring
e204297
andrewsg
andrewsg suggested changes Dec 4, 2020
View reviewed changes
Comment thread google/cloud/storage/acl.py Outdated
self.add_entity(self.entity_from_dict(entry))

def _save(self, acl, predefined, client, timeout=_DEFAULT_TIMEOUT):
def _save(

@andrewsg andrewsg Dec 4, 2020

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

We've investigated and found that ACL save retries don't support the concurrency control we'd need to have full faith in retries here. Please go ahead and remove them. Thanks!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@HemangChothani
feat: remove retry for acl
71bdd7e
andrewsg
andrewsg approved these changes Dec 9, 2020
View reviewed changes

@andrewsg andrewsg left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

LGTM. Thanks for your efforts here!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@andrewsg

andrewsg commented Dec 9, 2020

Copy link
Copy Markdown
Contributor

@HemangChothani are we clear to merge?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@HemangChothani

HemangChothani commented Dec 9, 2020

Copy link
Copy Markdown
Contributor Author

@andrewsg Yes.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@andrewsg
andrewsg merged commit 910e34c into googleapis:master Dec 9, 2020
cojenco pushed a commit to cojenco/python-storage that referenced this pull request Oct 13, 2021
@HemangChothani @cojenco
feat: make retry parameter public and added in other methods (googlea…
98bd78a
…pis#331)

* feat: make retry parameter public and added in other methods

* feat: change in doc string

* feat: changes in docstring

* feat: remove retry for acl
cojenco pushed a commit to cojenco/python-storage that referenced this pull request Oct 13, 2021
@HemangChothani @cojenco
feat: make retry parameter public and added in other methods (googlea…
3e4b8aa
…pis#331)

* feat: make retry parameter public and added in other methods

* feat: change in doc string

* feat: changes in docstring

* feat: remove retry for acl
@release-please release-please Bot mentioned this pull request Jan 12, 2022
chore(main): release 3.0.0 #688
Closed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@tseaver tseaver Awaiting requested review from tseaver
2 more reviewers
@frankyn frankyn frankyn left review comments
@andrewsg andrewsg andrewsg approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

api: storage Issues related to the googleapis/python-storage API. cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Add a default retry parameter to all public methods

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@HemangChothani @andrewsg @frankyn
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.