Google-cloud-python: would like to be able to specify timeout for get_bucket and download_to_file

Created on 8 Feb 2017  路  5Comments  路  Source: googleapis/google-cloud-python

I am using some methods from this file gcloud/storage/client.py

Specifically, get_bucket and list_bucket.

I am struggling to figure out how I should set timeouts on these methods. I am worried about them being stuck.

feature request storage

Most helpful comment

@lukesneeringer could you please re-open this issue? AFAIK it has not been addressed although I may be wrong. In that case, would you mind telling us where in the code, docs or commits/PRs can we find out the solution to this issue?

All 5 comments

Hello @pdudnik!

Currently I don't think there is a way to set the timeout for storage operations directly.
However you may be able to pass in your own HTTP client with a timeout set.

Also, I noticed that you're using gcloud. I would recommend that you update to the google-cloud package.

Note: Related to #2993.

Exposing timeouts as arguments to API-invoking methods is a thing we have done piecemeal to date, with incomplete efforts across multiple APIs. I wonder if there is a more satisfactory solution using a policy on the API-invoking object (usually the client via one of its helpers).

Closing as being handled by @jonparrott's retry strategy.

@lukesneeringer could you please re-open this issue? AFAIK it has not been addressed although I may be wrong. In that case, would you mind telling us where in the code, docs or commits/PRs can we find out the solution to this issue?

Was this page helpful?
0 / 5 - 0 ratings