sarama icon indicating copy to clipboard operation
sarama copied to clipboard

Should share the max retries of metadata?

Open yitian108 opened this issue 1 year ago • 1 comments

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

yitian108 avatar May 13 '24 09:05 yitian108

I’ve not really heard of a situation where attempts are per specific error issue, rather than just generically for any issue.

puellanivis avatar May 13 '24 12:05 puellanivis

Thank you for taking the time to raise this issue. However, it has not had any activity on it in the past 90 days and will be closed in 30 days if no updates occur. Please check if the main branch has already resolved the issue since it was raised. If you believe the issue is still valid and you would like input from the maintainers then please comment to ask for it to be reviewed.

github-actions[bot] avatar Aug 11 '24 14:08 github-actions[bot]