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 newSession() infinite loop #2640

Closed
nbajaj90 opened this issue Sep 5, 2023 · 1 comment · Fixed by #2642
Closed

consumer_group newSession() infinite loop #2640

nbajaj90 opened this issue Sep 5, 2023 · 1 comment · Fixed by #2642
Labels

Comments

@nbajaj90
Copy link

nbajaj90 commented Sep 5, 2023

return c.newSession(ctx, topics, handler, retries)

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:

switch join.Err {

Example code required:
select { case <-ctx.Done(): return nil, ctx.Err() default: }

@dnwe
Copy link
Collaborator

dnwe commented Sep 6, 2023

Thanks, this is a general bug that the newSession and retryNewSession funcs should both be checking for ctx cancellation to exit early before proceeding

@dnwe dnwe added the bug label Sep 6, 2023
dnwe added a commit that referenced this issue Sep 6, 2023
@dnwe dnwe closed this as completed in 05cb9fa Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants