| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
Thank you for your patience, it took a bit more time than I expected to review the PR.
Sorry, something went wrong.
| response.status_code = 200 | ||
| data = b"brent-spiner" | ||
| response._content = data | ||
| http.request.return_value = response |
There was a problem hiding this comment.
this test is missing the comment the other tests have. There may be a way to refactor this also, but unsure if it is warranted.
Sorry, something went wrong.
There was a problem hiding this comment.
Which comment is missing?
Sorry, something went wrong.
|
@crwilcox @frankyn PTAL. Changes include:
Responded to all other comments as well. |
Sorry, something went wrong.
There was a problem hiding this comment.
Generally LGTM, clean design with minimal impact on the code base!
Have documentation comment requests
Sorry, something went wrong.
| exceptions.BadGateway, # 502 | ||
| exceptions.ServiceUnavailable, # 503 | ||
| exceptions.GatewayTimeout, # 504 | ||
| requests.ConnectionError, |
There was a problem hiding this comment.
@tritone this is a change in what we discussed around retrying ConnectionErrors in general. Discussed this with @andrewsg w.r.t retrying unable to connect errors and for now implementation is moving forward with this solution until it's baked into the api_core libraries. Rationale, there's a default timeout enabled that would timeout the retry compared to Golang which does not.
Sorry, something went wrong.
There was a problem hiding this comment.
Got it, this seems fine to me re: the fact that there is a default timeout in python. So the idea is that down the road, we can add an error in api_core which catches "connection reset by peer" more specifically?
Sorry, something went wrong.
There was a problem hiding this comment.
that's correct, because right now requests.ConnectionError is tied to a specific implementation, e.g. requests and should be wrapped by api_core / cloud_core for it to be used generally outside of just the GCS library.
Sorry, something went wrong.
There was a problem hiding this comment.
I'm not totally convinced that retrying for a little while by default if there is an interruption due to network outage is not the right thing to do anyways, but yes, the idea is that instead of tapping into requests here we would have a custom api_core exception like we do with other errors.
Sorry, something went wrong.
|
@frankyn Added documentation as requested, PTAL |
Sorry, something went wrong.
There was a problem hiding this comment.
Couple small comments, generally looks really good!
Sorry, something went wrong.
| exceptions.BadGateway, # 502 | ||
| exceptions.ServiceUnavailable, # 503 | ||
| exceptions.GatewayTimeout, # 504 | ||
| requests.ConnectionError, |
There was a problem hiding this comment.
Got it, this seems fine to me re: the fact that there is a default timeout in python. So the idea is that down the road, we can add an error in api_core which catches "connection reset by peer" more specifically?
Sorry, something went wrong.
| To modify the default retry behavior, call a ``with_XXX`` method | ||
| on ``DEFAULT_RETRY``. For example, to change the deadline to 30 seconds, | ||
| pass ``retry=DEFAULT_RETRY.with_deadline(30)``. See google-api-core reference | ||
| (https://googleapis.dev/python/google-api-core/latest/retry.html) for details. |
There was a problem hiding this comment.
Would it be worth having a short sample snippet here rather than explaining and inlining? Might make it easier to understand what's necessary.
Sorry, something went wrong.
There was a problem hiding this comment.
I decided against this since a useful snippet here would have to show how to actually inject the modified retry via user code, and that feature is out of scope for this PR (will require changing the signature of every method in the library).
Sorry, something went wrong.
|
Just wonder if the blob.update() also has the retry logic with this feature. Is there any way to specify the retry number? Update: followed the API core doc, using DEFAULT_RETRY as decorator seems works. But how can I confirm if the retry happened? Update: there is a fix on this PR #340 |
Sorry, something went wrong.
Retries errors for idempotent API calls by default. Some API calls are conditionally idempotent (only idempotent if etag, generation, if_generation_match, if_metageneration_match are specified); in those cases, retries are also conditional on the inclusion of that data in the call.
Retries errors for idempotent API calls by default. Some API calls are conditionally idempotent (only idempotent if etag, generation, if_generation_match, if_metageneration_match are specified); in those cases, retries are also conditional on the inclusion of that data in the call.
| Back | FazBrowse Home | New Git URL |
Fixes #108
Related: https://github.com/googleapis/google-cloud-python/issues/9298