-
Notifications
You must be signed in to change notification settings - Fork 4
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
The http object doesn't need to be service specific #5
Comments
You are correct. This made more sense when we only supported gcloud I think credential handling is also not 100% correct right now, if you pass in a set of credentials to your client they will be ignored in favor of the ones generated for our connection objects, but this seems like it'd be harder to solve in a nice way since |
Er, didn't mean to close it :P |
Gotcher. That class seems to have some very specific values. I'd be interested in bringing some of it upstream, though I'm curious about some of the values. Have you given feedback to the datastore folks that 500's and 503's seem to be common? I'm surprised to see 403 and 409 in there though, as those should be well-defined / don't need a retry. |
👍 We'd love to see those handled upstream. For the most part, we implemented the retries and values as listed in the error handling docs but the backoff function and retry counts are our own where that doc doesn't specify a maximum.
|
I was unaware that 403 was overloaded by the service. That seems scary to me and I'd say if we were to hard-code the logic in, we'd want to do a bit more (like check that the 403 is for a It seems the 409 retry behavior should be built into your code that does transactions rather than the connection itself. |
The code currently does this in reverse: it checks if Re the
Could gcloud expose a more meaningful exception in that situation rather than just Conflict or is that out of scope? In doing this at the client level right now, one would either have to assume that all |
So, expanding on what @Bogdanp noted above, the enhancement here would have to involve the end user always specifying both the So for example (inventing a new thing called
The issue then is that if the user (for whatever reason) does not also supply We could parameterize it; something like:
But, we'd need to either special-case datastore ( But then of course, if all of the datastore-specific work moves upstream, this last point is negated. Thoughts or preferences from either of you? @Bogdanp @dhermes Also, I think we should open new issues for any remaining questions on retries and enhancing |
I don't have preferences for the current set-up or your suggestion. I think we'd need to see what it'd look like if we make a custom class. In googleapis/google-cloud-python#1274 @jonparrott has made us re-consider the current set-up so hopefully after the dust clears there, we can have a better idea of how to over-ride without having to have a credentials object to authorize with. |
Your README says
but they all just assume that
http.request
is defined (with a given signature), so no special casing needs to be done. (Caveat,storage.Blob.generate_signed_url
ALSO requires a credentials object.)The text was updated successfully, but these errors were encountered: