Skip to content

num_retries for all requests like googleapiclient #3133

@xmedeko

Description

@xmedeko

I am confused about the num_retries differences between the old googleapiclient and the new google-cloud-python.

I am able to specify num_retries for all API requests with the old googleapiclient by either

  1. specifying num_retries for all requests
  2. or supplying own requestBuilder for the googleapiclient.discovery.build which subclasses the original googleapiclient.http.HttpRequest and sets num_retries for all API requests.

The new google-cloud-python allows num_retries just for the storage blob upload. Is there other way to specify num_retries for other API calls? I think that all API calls (including Datastore, etc.) may fail by HTTP 500 or 429 and then they need to retry the requests, e.g. see https://cloud.google.com/storage/docs/exponential-backoff

Also, the googleapiclient.http._should_retry_response() seems different than google.cloud.streaming.http_wrapper.make_api_request(). E.g. the old one examines the response JSON payload, too.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions