sarama icon indicating copy to clipboard operation
sarama copied to clipboard

consumergroup example 'ErrClosedConsumerGroup error' can cause the program to hang

Open dakunge opened this issue 1 year ago • 2 comments

Description

https://github.com/IBM/sarama/blob/main/examples/consumergroup/main.go#L111

this return will hang at below code,i think for loop cannot exist https://github.com/IBM/sarama/blob/main/examples/consumergroup/main.go#L132

Versions
Sarama Kafka Go
Configuration

Logs
logs: CLICK ME


Additional Context

dakunge avatar Sep 15 '23 14:09 dakunge

@dakunge whilst that's true, I thought the only way of triggering ErrClosedConsumerGroup was if the user explicitly called client.Close(), which in the example doesn't happen until after the for keepRunning { ... } loop has already exited https://github.com/IBM/sarama/blob/98ec384372ecbb9d86036c6f210f840c45dbfa70/examples/consumergroup/main.go#L146

I guess we could call cancel() before the return, just to be sure both are coordinated in shutdown

dnwe avatar Sep 15 '23 15:09 dnwe

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 Feb 01 '24 22:02 github-actions[bot]