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

Should share the max retries of metadata? #2895

Open
yitian108 opened this issue May 13, 2024 · 1 comment
Open

Should share the max retries of metadata? #2895

yitian108 opened this issue May 13, 2024 · 1 comment

Comments

@yitian108
Copy link

Description

When reviewing the function tryRefreshMetadata() in client.go, I noticed a shared variable attemptsRemaining (initialized as Metadata.Retry.Max) within the subfunction retry(). Every call to the function retry() decreases the value of attemptsRemaining. For instance, if the initial value of attemptsRemaining is 3, when the broker is unavailable, it decreases by 1. In another scenario where there is no leader for some partitions, attemptsRemaining decreases from 2 instead of the initial value of 3. Shouldn't it be reset for different reasons?

The snippet of the func tryRefreshMetadata()

image

Sarama version: 1.42.2

@puellanivis
Copy link
Contributor

I’ve not really heard of a situation where attempts are per specific error issue, rather than just generically for any 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

No branches or pull requests

2 participants