Open GoogleCodeExporter opened 9 years ago
I understand the problem, but exponential backoff is not a solution.
Credentials always checks the Storage for an updated credential before
refreshing:
http://code.google.com/p/google-api-python-client/source/browse/oauth2client/client.py#572
Are the 10+ machines not reading the Credential from a common Storage instance?
Original comment by jcgregorio@google.com
on 1 Nov 2012 at 6:27
Exponential backoff is the only solution when you are using a shared refresh
token.
The 10+ machines are not reading the Credential from a common Storage instance.
The common case is that a single storage is persisted and copied, and then all
10+ instances operate on their copy.
Enforcing that all clients managed shared refresh token in a single common
Storage (so they can also share access tokens) is neither documented nor
obvious, nor is there code to nicely do so.
Original comment by nherr...@google.com
on 1 Nov 2012 at 7:49
"""
The 10+ machines are not reading the Credential from a common Storage instance.
The common case is that a single storage is persisted and copied, and then all
10+ instances operate on their copy.
"""
Don't do that :)
"""
Enforcing that all clients managed shared refresh token in a single common
Storage (so they can also share access tokens) is neither documented nor
obvious, nor is there code to nicely do so.
"""
So let's fix *that* problem. What are the available shared storage mechanisms
available to you? Memcache? A database? Other?
Original comment by jcgregorio@google.com
on 1 Nov 2012 at 7:53
Oh, I heartily concur. We need to fix that problem _generally_ (across language
clients and classes of customers), even if we have some specific optimizations
to people who have access to AppEngine's robot credential, Compute Engine's
metadata service, or some kind of global locking service a la Chubby -- more
importantly, we need to fix that problem for developers who have none of the
previous.
That said, that's an entirely separate issue, and it does not address the one
when people have not (due to lack of a solution, or lack of awareness of the
solution, or lack of time to implement the solution) solved the problem and run
into this case. Either we should emit an appropriate Exception (e.g., that
you're rate limited) in the cases where the developer wants full control over
when/how HTTP requests are made, or nicely handle it for them, when the
developer wants a fire-and-forget request that just does the work and deals
with server error retries, etc.
If (when?) we come up with a solution to the above issue, I'm assuming I'll
come back and make language-specific documentation requests about how best to
implement it in, say, Python. If you want to work from the specific to the
general, let me know the new issue you file and I'll track it as well.
Original comment by nherr...@google.com
on 1 Nov 2012 at 8:51
403's are no longer accepted as challenges:
https://code.google.com/p/google-api-python-client/source/detail?r=accbae09fb505
f9ee30bd67f4801a903c70ce6a5
Original comment by jcgregorio@google.com
on 12 Feb 2013 at 8:54
Any reason why 403's are no longer accepted? The server still responses with
403's if the client sends requests too quickly. How do we deal with this?
Original comment by wonder...@google.com
on 10 Feb 2014 at 11:14
Original issue reported on code.google.com by
nherr...@google.com
on 1 Nov 2012 at 6:17