lianetm commented on code in PR #16017:
URL: https://github.com/apache/kafka/pull/16017#discussion_r1617632335


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/HeartbeatRequestManager.java:
##########
@@ -208,7 +209,8 @@ public NetworkClientDelegate.PollResult poll(long 
currentTimeMs) {
             return new 
NetworkClientDelegate.PollResult(heartbeatRequestState.heartbeatIntervalMs, 
Collections.singletonList(leaveHeartbeat));
         }
 
-        boolean heartbeatNow = membershipManager.shouldHeartbeatNow() && 
!heartbeatRequestState.requestInFlight();
+//        boolean heartbeatNow = membershipManager.shouldHeartbeatNow() && 
!heartbeatRequestState.requestInFlight();
+        boolean heartbeatNow = membershipManager.state() == 
MemberState.LEAVING || membershipManager.shouldHeartbeatNow() && 
!heartbeatRequestState.requestInFlight();

Review Comment:
   nit: I find that adding a line break after the || makes it easier to 
understand (splitting the 2 cases that come out of this)



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to