cadonna commented on code in PR #15033:
URL: https://github.com/apache/kafka/pull/15033#discussion_r1430387778


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/MembershipManagerImpl.java:
##########
@@ -405,8 +405,8 @@ private void 
processAssignmentReceived(ConsumerGroupHeartbeatResponseData.Assign
                 assignmentUnresolved, currentAssignment);
             // Make sure we transition the member back to STABLE if it was 
RECONCILING (ex.
             // member was RECONCILING unresolved assignments that were just 
removed by the
-            // broker).
-            if (state == MemberState.RECONCILING) {
+            // broker), or JOINING (member joining received empty assignment).
+            if (state == MemberState.RECONCILING || state == 
MemberState.JOINING) {
                 // This is the case where a member was RECONCILING an 
unresolved
                 // assignment that was removed by the broker in a following 
assignment.

Review Comment:
   This comment is not completely correct anymore. It only describes one case 
of the two. Doesn't this comment  duplicate the comment above the 
`if`-statement.
   I really strongly recommend to not use too many inline comments. They are 
really hard to properly maintain as we can see here.



##########
clients/src/test/java/org/apache/kafka/clients/consumer/internals/MembershipManagerImplTest.java:
##########
@@ -1403,6 +1403,14 @@ public void testHeartbeatSentOnStaledMember() {
         assertEquals(MemberState.JOINING, membershipManager.state());
     }
 
+    @Test
+    public void 
testMemberJoiningTransitionsToStableWhenReceivingEmptyAssignment() {

Review Comment:
   Is there also a test for the second case? I skimmed over the test class but 
could not find one.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to