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

Properly report retry counts when refreshing the lead broker #10

Merged
merged 1 commit into from
Jun 25, 2020

Conversation

faec
Copy link
Collaborator

@faec faec commented Jun 24, 2020

(This is a resubmission of #7, after we realized we needed to switch to a different base version due to other outstanding bugs. This PR uses the new repository structure documented in #9 so it applies against the correct branch and base version. Original pull request description below.)

This is a fix for elastic/beats#19015, in which Sarama fails to apply exponential backoff when Producer.Retry.BackoffFunc is set to an exponential backoff function.

Sarama tracks producer retries per-message, and updates them when receiving a response from the broker. This means that when there is no broker, the retry count never gets incremented. Thus, retries of send attempts to a valid broker will properly apply the exponential backoff, but retries while connecting to the broker itself will always retry with the initial backoff time.

I have modified the wait so that it tracks retries on the broker itself separately from retries on its pending messages. Local tests as described in elastic/beats#19015 confirm that exponential backoff is now correctly applied when the broker is down.

@faec faec requested a review from kvch June 24, 2020 18:09
@faec faec merged commit 2a1365d into elastic:beats-fork Jun 25, 2020
@faec faec deleted the backoff-fix-fork branch June 25, 2020 13:34
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.

2 participants