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
Add optional retry for transient errors. #14
Comments
After looking into this further the check should be on the code 2 - API ServiceTemporary issue due to downtime - retry the operation after waiting not on the is_transient field. |
Hi bdiesenhaus, in next version we'll provide interface to override sendGet, sendPost, and sendDelete in APIRequest, where you can easily customize and add auto-retry logic. We don't have plan to add the retry in SDK, because it could be risky to silently retry requests, especially for POST, which could potentially create duplicated ads. |
@JiamingFB , thanks any idea on timing of the next version? |
The next SDK version will come with the next API version, which is expected to be in April. |
New version was just released. |
I get a decent amount of transient errors while calling the Facebook api. Immediate retries of the same request work. It would be nice to add retry support into the sdk, possibly in APIRequest.callInternal(). The response has the is_transient field in it, if this is true it would be nice if the sdks retried instead of all calling clients to have to catch the APIException, check if it it is transient and then retry everywhere a request is made. Making this optional by adding a boolean (retry) with the number of retry attempts to the APIContext would allow for users to turn retries on or off.
Exception from sdks:
com.facebook.ads.sdk.APIException: {"error":{"message":"An unexpected error has occurred. Please retry your request later.","type":"OAuthException","is_transient":true,"code":2,"fbtrace_id":"DAbvR5wiN2d"}}
The text was updated successfully, but these errors were encountered: