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

Handle receiving empty member assignment #567

Merged
merged 8 commits into from
Nov 29, 2019

Conversation

Nevon
Copy link
Collaborator

@Nevon Nevon commented Nov 28, 2019

Fixes #550.

This is a slightly different approach than #551 because I wanted to make sure that the MemberAssignment decoder could handle receiving a buffer with insufficient data, instead of expecting the caller to do the checking for it.

@Nevon Nevon requested a review from JaapRood November 28, 2019 14:48
types/index.d.ts Outdated
@@ -338,7 +338,7 @@ export type MemberAssignment = {

export const AssignerProtocol: {
MemberMetadata: ISerializer<MemberMetadata>
MemberAssignment: ISerializer<MemberAssignment>
MemberAssignment: ISerializer<MemberAssignment | null>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That means MemberAssignment#encode() would need to handle null as well now, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right! Took me a bit to see what you meant, but yes indeed, it would mean that encode would also need to handle receiving null.

I changed it now so that only the decode has a nullable return type.

@tulios
Copy link
Owner

tulios commented Nov 29, 2019

@Nevon can you add an integration test?

Copy link
Collaborator

@JaapRood JaapRood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

The test assigner only returns assignments for the first member of the
group, and not the second one. Without #567 the second consumer will
crash when trying to decode the missing assignment.
@Nevon
Copy link
Collaborator Author

Nevon commented Nov 29, 2019

@Nevon can you add an integration test?

Done! 9c97aac

@tulios tulios merged commit 2472802 into master Nov 29, 2019
@Nevon Nevon deleted the handle-empty-member-assignment branch November 29, 2019 10:22
@tulios tulios mentioned this pull request Dec 4, 2019
2 tasks
Nevon added a commit that referenced this pull request Dec 6, 2019
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.

RangeError in consumer group syncGroup response processing for member without assignment
4 participants