frankvicky commented on code in PR #23357:
URL: https://github.com/apache/kafka/pull/23357#discussion_r4678002539


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/HeartbeatRequestState.java:
##########
@@ -70,6 +70,11 @@ public void resetTimer() {
 
     public long timeToNextHeartbeatMs(final long currentTimeMs) {
         if (heartbeatTimer.isExpired()) {
+            if (requestInFlight()) {
+                // The heartbeat timer can expire while a request is in 
flight, and the backoff since the
+                // last response may already be exhausted. Wait the retry 
backoff to avoid a busy loop.
+                return retryBackoffMs();

Review Comment:
   nit: could we add this case to the `poll()` Javadoc in 
`AbstractHeartbeatRequestManager` and `StreamsGroupHeartbeatRequestManager`?
   
   Both list the possible values of the time to wait until the next poll, and 
neither mentions that we now wait the retry backoff when the heartbeat timer 
expires while a request is in flight.



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