-
Notifications
You must be signed in to change notification settings - Fork 90
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
Retry RESOURCE_EXHAUSTED errors #337
Comments
Hi @yiga2,
The only error considered safe to retry across the board is Is it possible the call is retried too quickly and fails as the quota hasn't yet been reset? You could try tweaking the python-api-core/google/api_core/retry.py Lines 72 to 75 in 34ebdcc
|
I understand the error is not retried automatically but the code snippet above makes it retry, and I checked and DocAI does not bill for incomplete calls. @busunkim96 You raised a good point on the quota reset as I misread the limit - the quota is per min, not per sec (which is more common). As the calls originate from cloud functions, I don't control the rate but can definitely tweak the settings. Looking at the initial call in the screenshot, the deadline must be culprit as +3 min passed - I will extend but it would be good if the retry library could log when deadline is reached (and only that event, not every retry). |
We recently added retry support for It's more subtle than other retries we've done so far, as the response message can contain a suggested sleep time until the next request (at least in the case of BigQuery, not sure if that's a general Google API thing) |
We are using a cloud function that, among others, calls
DocumentAI
. Assuming the latter has implemented the Retry dependency correctly, we have the following code that should retry when hitting a (retriable) quota limit:However, the call is not retried as cloud logging shows:
![image](https://user-images.githubusercontent.com/25224265/151846319-6c231c41-af2f-4ba6-8b8c-5608db5ce8f9.png)
Any clue ?
The text was updated successfully, but these errors were encountered: