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

Feature request: Backoff the retry when gateway reports RESOURCE_EXHAUSTED #70

Open
jwulf opened this issue Jan 11, 2022 · 7 comments · Fixed by #71
Open

Feature request: Backoff the retry when gateway reports RESOURCE_EXHAUSTED #70

jwulf opened this issue Jan 11, 2022 · 7 comments · Fixed by #71

Comments

@jwulf
Copy link
Member

jwulf commented Jan 11, 2022

When the broker signals backpressure, the Kafka sink responds with an immediate retry.

See: https://github.com/camunda-community-hub/kafka-connect-zeebe/blob/master/src/main/java/io/zeebe/kafka/connect/sink/ZeebeSinkFuture.java#L76

It should backoff the retry to give the broker a chance to recover.

@berndruecker
Copy link
Collaborator

berndruecker commented Jan 11, 2022

Great finding (based on https://forum.camunda.io/t/kafka-sink-connector-high-cpu-utilisation/2667/5)!

"I am performing load test with simple BPMN. BPMN have two task one is source and another one is SINK task. I am using the Zeebe kafka connector open source repository for async communication model. Whenever zeebe client started throwing error “RESOURCE_EXHUSTED” then SINK connector CPU utilisation reached to 100%. I dig into the code and found that recursive call to retry until it receive the successful code or failure code. Load test service is creates instances with the rate of 7K RPM. I also observe that backpressure limit went down to 5."

The biggest question is what strategy to use in case of backpressure 🤔

@jwulf
Copy link
Member Author

jwulf commented Jan 11, 2022

The easy and obvious one is t = 2 * t. So, 1s, 2s, 4s, 8s, 16s, 32s, 64s ... Maybe with a maximum bound?

This is how I do it in the Node client.

@berndruecker
Copy link
Collaborator

This is about the backoff timing, but we would also need to throttle/stop consuming records from Kafka, otherwise, we build up a huge pile of unprocessed tasks in memory, which will lead to problems sooner or later.

Let's table it for the moment. I find this a fascinating problem I would love to come back on when we have a bit of time.

@berndruecker
Copy link
Collaborator

Quick update: @falko has contact with a customer where this might get a more urgent request. We will look at it together sometime within the next few weeks.

@berndruecker
Copy link
Collaborator

@berndruecker
Copy link
Collaborator

reminder for me: Pile of tasks in memory is no problem because we do not retrieve new tasks before the others are completed at the moment

@berndruecker
Copy link
Collaborator

Waiting for customer to confirm that this solves the issue

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 a pull request may close this issue.

2 participants