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


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractHeartbeatRequestManager.java:
##########
@@ -345,7 +345,15 @@ private void onFailure(final Throwable exception, final 
long responseTimeMs) {
 
     private void onResponse(final R response, final long currentTimeMs) {
         if (errorForResponse(response) == Errors.NONE) {
-            
heartbeatRequestState.updateHeartbeatIntervalMs(heartbeatIntervalForResponse(response));
+            long previousHeartbeatIntervalMs = 
heartbeatRequestState.heartbeatIntervalMs();
+            long heartbeatIntervalMs = heartbeatIntervalForResponse(response);
+            // The heartbeat interval is a group config owned by the broker, 
so log it when it changes to give
+            // visibility into the value the coordinator is applying (it is 
not derivable from client config).
+            if (heartbeatIntervalMs != previousHeartbeatIntervalMs) {
+                logger.info("{} received heartbeat interval {}ms from the 
group coordinator (was {}ms)",
+                    heartbeatRequestName(), heartbeatIntervalMs, 
previousHeartbeatIntervalMs);

Review Comment:
   "heartbeatRequestName() + received interval" will probably read weird, is 
the intention to say "Member <memberId> received interval"?
   
   Also I expect that in practice the previousHB will just be 0 (just the 
default the client has until it gets something from the GC), so not sure if 
maybe just logging what we got from the GC is enough? even in the less common 
case where the broker config for HB changes, what's relevant is that it was set 
to a new val (regardless of what it was before). wdyt? 



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