mjsax commented on code in PR #22730:
URL: https://github.com/apache/kafka/pull/22730#discussion_r3584831054


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/StreamsGroupHeartbeatRequestManager.java:
##########
@@ -650,9 +650,24 @@ private void onSuccessResponse(final 
StreamsGroupHeartbeatResponse response, fin
         
heartbeatRequestState.updateHeartbeatIntervalMs(data.heartbeatIntervalMs());
         heartbeatRequestState.onSuccessfulAttempt(currentTimeMs);
         
heartbeatState.setEndpointInformationEpoch(data.endpointInformationEpoch());
-        
streamsRebalanceData.setHeartbeatIntervalMs(data.heartbeatIntervalMs());
-        
streamsRebalanceData.setTaskOffsetIntervalMs(data.taskOffsetIntervalMs());
-        
streamsRebalanceData.setAcceptableRecoveryLag(data.acceptableRecoveryLag());
+        // A leaving member's response carries no group configuration (the 
fields hold protocol defaults), so do not
+        // log or store it while shutting down. Normal responses have 
memberEpoch >= 0; leave responses use the
+        // negative leave sentinels (fenced members take the error path 
instead). Log only when a value changes, to
+        // avoid repeating it on every heartbeat: this fires on first receipt 
(values start unset) and on any later change.
+        if (data.memberEpoch() >= 0) {

Review Comment:
   Is it really a behavior change? -- Also, how was this case handled in 
https://github.com/apache/kafka/pull/22749 ?
   
   In the end, when we leave, it seems to not make sense to log anything, but 
we could also do it differently, and still reset `streamsRebalanceData` as 
before, ie, just move the last 3 lines out of `if` block?
   
   But does it make any difference? We only leave a group when we `close()` the 
consumer right? So the `KafkaConsumer` object can only be discarded anyway? Not 
sure what behavior change you see?



-- 
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