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

Limit retry backoff (and unlimited retries) #750

Open
morrone opened this issue Feb 14, 2024 · 4 comments
Open

Limit retry backoff (and unlimited retries) #750

morrone opened this issue Feb 14, 2024 · 4 comments

Comments

@morrone
Copy link

morrone commented Feb 14, 2024

The existing retry options are a bit limiting:

max.retries
retry.backoff.ms

When the elasticsearch cluster is inaccessible (e.g. a network interruption), we want the connector to be resilient to that situation and resume operation when connectivity to elasticsearch is reestablished. And we want it to reconnect in a timely manner.

So first of all, it would be nice to allow a way to set max.retries to "unlimited". Granted, the max value of 2147483647 is pretty darn large, and probably going to be enough in practice.

But more important, we really need to put an upper limited on the retry backoff. It is nice that it is designed to "wait up to twice as long as the previous wait", but if elasticsearch is down for a few hours that would let the backoff time grow to an unacceptably long interval.

We could really use an option to cap the growth of the backoff to some maximum value.

@pricelessjunk
Copy link

I was looking into this a little. There does seem to be an upper limit to the back off time which is 24 hours. This value is also automatically applied after 32 attempts (due to overflow).

Did you want to make this configurable instead of it being a constant?

Reference -
https://github.com/confluentinc/kafka-connect-elasticsearch/blob/master/src/main/java/io/confluent/connect/elasticsearch/RetryUtil.java#L94

@morrone
Copy link
Author

morrone commented Mar 1, 2024

Yes, making it configurable would be great. We would want to configure the maximum to be something like 5-10 minutes.

@pricelessjunk
Copy link

Hey so I created a pull request for this change. #756.

Please verify if this is how you imagined it. If its good I can ask the maintainers to have a look.

@morrone
Copy link
Author

morrone commented Mar 2, 2024

Please verify if this is how you imagined it. If its good I can ask the maintainers to have a look.

Yes, that looks perfect. Thank you!

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