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

Add a way to limit maximum retry delay for exponential backoff #441

Open
KristjanTammekivi opened this issue Apr 2, 2024 · 1 comment
Open

Comments

@KristjanTammekivi
Copy link

Hi,
I would like for there to be a way to adjust maximum retry delay or configure it in some other way since even with minimum retry delay the exponential backoff sets a very large delay.

For instance with 1 second delay

postgres=# SELECT
    (
        1 * 2 ^ LEAST(16, i + 1) / 2 + 1 * 2 ^ LEAST(16, i + 1) / 2 * random()
    ) * interval '1'
FROM generate_series(1, 16) AS t(i);
    ?column?     
-----------------
 00:00:02.166215
 00:00:07.481996
 00:00:10.5314
 00:00:18.985739
 00:01:01.490028
 00:01:25.182171
 00:03:08.251286
 00:06:50.541206
 00:16:33.832786
 00:23:04.647317
 00:35:50.171085
 01:37:15.770498
 02:35:16.779842
 07:22:58.370967
 10:40:32.358324
 14:41:46.530635
(16 rows)

When using a 5 second retryDelay this gets even wilder with the last delay being constantly in the range of 40-90 hours

I'd like there to be some more tunability for this, maybe so we can configure the maximum power (currently 16), allow setting a maximum retryDelay, or allowing to pass in a custom SQL to decide that.

I know this was quickly discussed in #340 but I do think this should be reconsidered

@timgit
Copy link
Owner

timgit commented Oct 5, 2024

This should be addressed in v11

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

No branches or pull requests

2 participants