Closed nbajaj90 closed 1 year ago
https://github.com/IBM/sarama/blob/9e759865b0d47cd5598befc103c0c40b45784d3c/consumer_group.go#L311 If the error is ErrUnknownMemberId and context gets cancelled by some other go-routine, the above code can go in an infinite loop.
Need a check to cross-check if context is cancelled before below switch: https://github.com/IBM/sarama/blob/9e759865b0d47cd5598befc103c0c40b45784d3c/consumer_group.go#L305
Example code required: select { case <-ctx.Done(): return nil, ctx.Err() default: }
select { case <-ctx.Done(): return nil, ctx.Err() default: }
Thanks, this is a general bug that the newSession and retryNewSession funcs should both be checking for ctx cancellation to exit early before proceeding
https://github.com/IBM/sarama/blob/9e759865b0d47cd5598befc103c0c40b45784d3c/consumer_group.go#L311 If the error is ErrUnknownMemberId and context gets cancelled by some other go-routine, the above code can go in an infinite loop.
Need a check to cross-check if context is cancelled before below switch: https://github.com/IBM/sarama/blob/9e759865b0d47cd5598befc103c0c40b45784d3c/consumer_group.go#L305
Example code required:
select { case <-ctx.Done(): return nil, ctx.Err() default: }