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

Consumer group client does not back-off / retry for possible error scenarios #1715

Closed
dotnwat opened this issue Jun 2, 2020 · 2 comments
Closed

Comments

@dotnwat
Copy link

dotnwat commented Jun 2, 2020

Versions
Sarama Kafka Go
0189d59 2.4
Configuration
config.Version = sarama.V2_4_0_0
config.Consumer.Return.Errors = true
config.Consumer.Offsets.Initial = sarama.OffsetNewest
Logs
2020/06/02 10:39:50 Initializing new client
2020/06/02 10:39:50 client/metadata fetching metadata for all topics from broker localhost:9092
2020/06/02 10:39:50 Connected to broker at localhost:9092 (unregistered)
2020/06/02 10:39:50 client/brokers registered new broker #1 at 0.0.0.0:9092
2020/06/02 10:39:50 Successfully initialized new client
2020/06/02 10:39:50 client/metadata fetching metadata for [sanfrancisco] from broker localhost:9092
2020/06/02 10:39:50 client/metadata found some partitions to be leaderless
2020/06/02 10:39:50 client/metadata retrying after 250ms... (3 attempts remaining)
2020/06/02 10:39:50 client/metadata fetching metadata for [sanfrancisco] from broker localhost:9092
2020/06/02 10:39:50 client/coordinator requesting coordinator for consumergroup sfo-consumer-group from localhost:9092
2020/06/02 10:39:50 client/coordinator coordinator for consumergroup sfo-consumer-group is #1 (0.0.0.0:9092)
2020/06/02 10:39:50 Connected to broker at 0.0.0.0:9092 (registered as #1)
2020/06/02 10:39:50 ProcessingLoop error:  kafka server: The broker is still loading offsets after a leader change for that offset's topic partition.
Problem Description

When calling Consume on a consumer group client the Kafka broker is returning the error COORDINATOR_LOAD_IN_PROGRESS = 14 when joining the group, but Sarama does not appear to implement the back-off / retry logic for this error condition. It only does back-off / retry for NOT_COORDINATOR = 16 (see here: https://github.com/Shopify/sarama/blob/master/consumer_group.go#L227).

This case is handled in kafka java reference client (see: https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractCoordinator.java#L609).

Generally this error COORDINATOR_LOAD_IN_PROGRESS and NOT_COORDINATOR and COORDINATOR_NOT_AVAILABLE are all valid errors from any of the group membership APIs.

Sarama handles the load in progress condition for fetching offsets, but when we experience this error via join group, the client doesn't retry as expected.

@ghost ghost added the stale Issues and pull requests without any recent activity label Mar 16, 2021
@dnwe dnwe removed the stale Issues and pull requests without any recent activity label Dec 2, 2022
@IBM IBM deleted a comment Dec 2, 2022
@dnwe
Copy link
Collaborator

dnwe commented Dec 2, 2022

Closing as dupe of #2058 believed to be fixed (via #2214) in v1.33.0 and newer

@github-actions

This comment was marked as outdated.

@github-actions github-actions bot added the stale Issues and pull requests without any recent activity label Aug 24, 2023
@dnwe dnwe closed this as completed Aug 24, 2023
@dnwe dnwe removed the stale Issues and pull requests without any recent activity label Aug 24, 2023
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