-
Notifications
You must be signed in to change notification settings - Fork 135
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
Unable to disable retry functionality for error code 429 or rate limit exceeded #795
Comments
Thanks for reporting this bug. We will work on fixing this. Internal Ref: OKTA-564533 |
Seems related to this TODO. |
The rate limit retry logic is no longer being used in version 10.0.0. That accompanied with the fact we can't access the rate limit headers on an error makes this SDK unsafe for us to use in production. 10.0.0 is no longer using the rate limit retry logic and instead it is just creating a Spring RetryTemplate with a fixed backoff policy of 1 second. You are unable to set the max retries (is defaulting to 5) and there is no ability to change or configure the backoff policy. When you get a rate limit error because there is no logic in the SDK to use the headers, you are unable to do any rate limit management yourself because the ResourceException is missing the headers x-rate-limit-limit, x-rate-limit-limit, and x-rate-limit-reset |
We have a PR in the making that will address this concern. Stay tuned. |
Fix merged. |
Describe the bug?
As per doc https://github.com/okta/okta-sdk-java#connection-retry we should set below properties to 0 to disable retires
but looks like retries are hardcoded for error code 429 at
okta-sdk-java/api/src/main/java/com/okta/sdk/error/ErrorHandler.java
Line 103 in dc0b486
okta-sdk-java/api/src/main/resources/custom_templates/ApiClient.mustache
Line 910 in dc0b486
I want to handle retries externally and not from sdk which seems to be impossible for now for error code 429
What is expected to happen?
SDK should disable retries on error completely
What is the actual behavior?
SDK still retries for default times for 429 error code
Reproduction Steps?
Try to mock api response using mock server and see okta sdk behaviour when retries are disabled
Additional Information?
No response
Java Version
openjdk version "11.0.16.1" 2022-08-12
OpenJDK Runtime Environment Homebrew (build 11.0.16.1+0)
OpenJDK 64-Bit Server VM Homebrew (build 11.0.16.1+0, mixed mode)
SDK Version
v10.0.0
OS version
No response
The text was updated successfully, but these errors were encountered: