Skip to content
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

Closed
sahilnarwal opened this issue Jan 6, 2023 · 5 comments
Assignees
Labels

Comments

@sahilnarwal
Copy link

sahilnarwal commented Jan 6, 2023

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

okta.client.requestTimeout = 0
okta.client.rateLimit.maxRetries = 0

but looks like retries are hardcoded for error code 429 at

retryableExceptions.put(RetryableException.class, Boolean.TRUE);

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

@sahilnarwal sahilnarwal added the bug label Jan 6, 2023
@arvindkrishnakumar-okta
Copy link
Contributor

arvindkrishnakumar-okta commented Jan 6, 2023

Thanks for reporting this bug. We will work on fixing this.

Internal Ref: OKTA-564533

@clementdenis
Copy link
Contributor

Seems related to this TODO.

@duttkin
Copy link

duttkin commented Jan 19, 2023

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

@arvindkrishnakumar-okta
Copy link
Contributor

We have a PR in the making that will address this concern. Stay tuned.

@arvindkrishnakumar-okta
Copy link
Contributor

Fix merged.

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

No branches or pull requests

4 participants