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 can not stop refresh meta data after context canceled. #2991

Open
erlangtui opened this issue Sep 30, 2024 · 2 comments
Open

Comments

@erlangtui
Copy link

Description
  • consumer group can not stop refresh meta data after context canceled.
  • function func (c *consumerGroup) Consume(ctx context.Context, topics []string, handler ConsumerGroupHandler) error in consumer_group.go file, after ctx's cancel function exec, the function c.client.RefreshMetadata(topics...) in consumer_group.go file line 201, still working, can not stop.
Versions
Sarama Kafka Go
1.38.1 kafka_2.11-1.1.1 1.19
Configuration
Logs
logs: CLICK ME


Additional Context
@erlangtui
Copy link
Author

the above happened when a broker is down

@puellanivis
Copy link
Contributor

Hm… yeah. We even have the context available to plumb through that function. It seems that it’s relying on client.conf.Metadata.Timeout to provide a timeout/deadline rather than a context.WithDeadline or context.WithTimeout. It seems like plumbing a context through would even then simplify the deadline handling, since we wouldn’t have to do it all manually.

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