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


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/HeartbeatRequestManager.java:
##########
@@ -482,6 +482,15 @@ public long nextHeartbeatMs(final long currentTimeMs) {
             return heartbeatTimer.remainingMs();
         }
 
+        public void onFailedAttempt(final long currentTimeMs) {
+            // Reset timer to allow sending HB after a failure without waiting 
for the interval.
+            // After a failure, a next HB may be needed with backoff (ex. 
errors that lead to
+            // retries, like coordinator load error), or immediately (ex. 
errors that lead to
+            // rejoining, like fencing errors).
+            heartbeatTimer.reset(0);
+            super.onFailedAttempt(currentTimeMs);

Review Comment:
   no, it doesn't. The timer is only to indicate that an interval should be 
respected. In cases of failures, we don't want to follow the interval (so we 
reset timer to 0). Each error will :
   - send a next HB based on other conditions (ex. as soon as the coordinator 
is discovered, when releasing assignment finishes after getting fenced)
   -  not send a next HB at all (fatal errors)



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