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

Suppress JoinGroup V4+ response error log when memberId is empty #860

Merged
merged 4 commits into from
Sep 9, 2020

Conversation

Nevon
Copy link
Collaborator

@Nevon Nevon commented Sep 8, 2020

The first time a consumer joins the group, the broker will respond with an error telling us that we need to use a memberId that is returned together with the error. We catch this error and re-issue the request with the new memberId. However, since is is a protocol error, we would log an error that would cause some users to think that something was wrong, even though this is the normal operation when joining the group.

This refactoring moves the decision of whether or not to log the error response into the protocol itself, which allows us to get rid of the special case for ApiVersions in Connection.send. It also allows us to decide whether or not to log based on the request or response itself, as well as the version of the request. This is relevant in this case, as we don't want to log if there's an error in response to JoinGroupV4 and the memberId is empty, but we do want to log for older JoinGroup versions or when the memberId is in fact set already.

Fixes #856

This allows us to remove the special case for ApiVersions from
the Connection while also making the member_id_required suppression
be version aware, as we should only disable it for V4 when
memberId is empty.
Nevon and others added 2 commits September 8, 2020 20:39
We suppress response errors for later versions, as the broker
may not understand those versions and we should downgrade as a normal
part of the protocol negotiation, but if they don't understand
V0 we have no further recourse and should log the error.
@tulios tulios merged commit dca6481 into master Sep 9, 2020
@tulios tulios deleted the supress-first-member_id_required-error branch September 9, 2020 15:24
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

Successfully merging this pull request may close these issues.

Question about MEMBER_ID_REQUIRED error
2 participants