Skip to content

Conversation

C0urante
Copy link
Contributor

@C0urante C0urante commented Jul 29, 2023

Fixes #357

This uses a different approach than what was proposed in the issue, but the effect should be mostly the same. I drafted up the retrying(() -> kafkaConnectApi.getConnectorConfig(conectorToPatch)) patch but realized that this would still have to be manually applied to all REST calls that could result in a 409 response, which seemed fairly brittle.

I did some research and it looks like we can get retry logic with our auto-generated REST client for free by bringing in a small extra dependency: https://quarkus.io/guides/smallrye-fault-tolerance

Since the API for describing retriable requests with this library is based on exception class, I added custom subclasses to the KafkaConnectException to help us distinguish between retriable and non-retriable operations. We could theoretically create a RetriableKafkaConnectException umbrella class for those, but that feels a little premature, especially since some exceptions may be retriable for only a subset of requests that throw them.

I was able to get 10 consecutive green integration test runs locally with this patch.

@gunnarmorling
Copy link
Collaborator

Oooh, that's lovely! Much more elegant indeed, great find, and great improvement 🥳 !

@gunnarmorling gunnarmorling merged commit 971e866 into kcctl:main Jul 29, 2023
@C0urante C0urante deleted the gh-357 branch July 30, 2023 05:52
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

Successfully merging this pull request may close these issues.

Make PatchConnectorCommand more robust againt concurrent config changes
2 participants