Skip to content
This repository has been archived by the owner on Sep 16, 2022. It is now read-only.

storage_api: Avoid OverQuotaError from get_service_account_name #53

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

evanj
Copy link
Contributor

@evanj evanj commented Oct 26, 2016

Commit 10e7feb assigned app_identity.get_service_account_name to a local
variable, outside of the if statement. This means it gets called every time
this function is called, which makes an RPC on App Engine. During periods
of high activity, this can exceed the per-minute API quota and raise
OverQuotaError.

To fix this, only call this if local_run() is True, which should only
happen in development and never in App Engine production.

Commit 10e7feb assigned app_identity.get_service_account_name to a local
variable, outside of the if statement. This means it gets called every time
this function is called, which makes an RPC on App Engine. During periods
of high activity, this can exceed the per-minute API quota and raise
OverQuotaError.

To fix this, only call this if local_run() is True, which should only
happen in development and never in App Engine production.
@evanj
Copy link
Contributor Author

evanj commented Mar 20, 2018

I just found a bug in this change, a year and a half later! This tweak makes this work with both unit tests and dev_appserver.py

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant