-
Notifications
You must be signed in to change notification settings - Fork 26
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 exponential backoff and jitter to the retries #194
Comments
Hi @acm19, and thanks again for posting this! I totally agree that exponential backoff and jitter for retries is good to have. |
Hey @nehaev, I might try to find some time to give this a try but I wonder what your thoughts are about the implementation. I see two options, either we give only exponential retries as retry mechanism (we can then add a validation for |
Hey @acm19, I think having only exponential backoff retries is fine. We can introduce two more config options: |
Adds exponential backoff by multiplying the `retryTimeoutMs` by `2^attempt`. Adds a random jitter to spread out the retries. Although in the initial implementation the retry function isn't available to the user the code is written in a way that makes it easier to change that. Refactors the tests to avoid using `Thread#sleep`, which is not only a bad practice producing not deterministic tests but also makes them very slow. A reduction of more that 90% of testing time is percieved for the tests where this was changed. Resolves: loki4j#194
Adds exponential backoff by multiplying the `retryTimeoutMs` by `2^attempt`. Adds a random jitter to spread out the retries. Although in the initial implementation the retry function isn't available to the user the code is written in a way that makes it easier to change that. Refactors the tests to avoid using `Thread#sleep`, which is not only a bad practice producing not deterministic tests but also makes them very slow. A reduction of more that 90% of testing time is percieved for the tests where this was changed. Resolves: loki4j#194
Adds exponential backoff by multiplying the `retryTimeoutMs` by `2^attempt`. Adds a random jitter to spread out the retries. Although in the initial implementation the retry function isn't available to the user the code is written in a way that makes it easier to change that. Refactors the tests to avoid using `Thread#sleep`, which is not only a bad practice producing not deterministic tests but also makes them very slow. A reduction of more that 90% of testing time is percieved for the tests where this was changed. Resolves: loki4j#194
Adds exponential backoff by multiplying the `retryTimeoutMs` by `2^attempt`. Adds a random jitter to spread out the retries. Although in the initial implementation the retry function isn't available to the user the code is written in a way that makes it easier to change that. Refactors the tests to avoid using `Thread#sleep`, which is not only a bad practice producing not deterministic tests but also makes them very slow. A reduction of more that 90% of testing time is percieved for the tests where this was changed. Resolves: loki4j#194
Hey @nehaev, I've created a proposal. I think it's fine to leave the current config settings, I just updated the documentation. Please take a look and let me know your thoughts. |
Adds exponential backoff by multiplying the `retryTimeoutMs` by `2^attempt`. Adds a random jitter to spread out the retries. Although in the initial implementation the retry function isn't available to the user the code is written in a way that makes it easier to change that. Refactors the tests to avoid using `Thread#sleep`, which is not only a bad practice producing not deterministic tests but also makes them very slow. A reduction of more that 90% of testing time is percieved for the tests where this was changed. Resolves: loki4j#194
Adds exponential backoff by multiplying the `retryTimeoutMs` by `2^attempt`. Adds a random jitter to spread out the retries. Although in the initial implementation the retry function isn't available to the user the code is written in a way that makes it easier to change that. Refactors the tests to avoid using `Thread#sleep`, which is not only a bad practice producing not deterministic tests but also makes them very slow. A reduction of more that 90% of testing time is percieved for the tests where this was changed. Resolves: loki4j#194
Adds exponential backoff by multiplying the `retryTimeoutMs` by `2^attempt`. Adds a random jitter to spread out the retries. Although in the initial implementation the retry function isn't available to the user the code is written in a way that makes it easier to change that. Refactors the tests to avoid using `Thread#sleep`, which is not only a bad practice producing not deterministic tests but also makes them very slow. A reduction of more that 90% of testing time is percieved for the tests where this was changed. Resolves: loki4j#194
Adds exponential backoff by multiplying the `retryTimeoutMs` by `2^attempt`. Adds a random jitter to spread out the retries. Although in the initial implementation the retry function isn't available to the user the code is written in a way that makes it easier to change that. Refactors the tests to avoid using `Thread#sleep`, which is not only a bad practice producing not deterministic tests but also makes them very slow. A reduction of more that 90% of testing time is percieved for the tests where this was changed. Resolves: loki4j#194
Adds exponential backoff by multiplying the `retryTimeoutMs` by `2^attempt`. Adds a random jitter to spread out the retries. Although in the initial implementation the retry function isn't available to the user the code is written in a way that makes it easier to change that. Refactors the tests to avoid using `Thread#sleep`, which is not only a bad practice producing not deterministic tests but also makes them very slow. A reduction of more that 90% of testing time is percieved for the tests where this was changed. Resolves: loki4j#194
Current retries are constant which might cause snowball effect if many client get rate limited at the same time. Retries should have a exponential backoff and jitter to avoid this.
The text was updated successfully, but these errors were encountered: