dajac commented on code in PR #15311:
URL: https://github.com/apache/kafka/pull/15311#discussion_r1483161952


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/RequestState.java:
##########
@@ -132,6 +132,16 @@ public void onFailedAttempt(final long currentTimeMs) {
         this.numAttempts++;
     }
 
+    /**
+     * Set backoff and number of attempts to 0. This will ensure that the 
request is sent out
+     * again right away. Expected to be used when receiving errors responses 
that lead to a new
+     * request that can be sent without backing off (ex. member rejoining 
after fencing)
+     */
+    public void resetBackoff() {

Review Comment:
   I just realized that we already have `reset` which is used for a similar 
purpose. Could we reuse it?



##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/RequestState.java:
##########
@@ -132,6 +132,16 @@ public void onFailedAttempt(final long currentTimeMs) {
         this.numAttempts++;
     }
 
+    /**
+     * Set backoff and number of attempts to 0. This will ensure that the 
request is sent out
+     * again right away. Expected to be used when receiving errors responses 
that lead to a new
+     * request that can be sent without backing off (ex. member rejoining 
after fencing)
+     */
+    public void resetBackoff() {
+        this.backoffMs = 0;

Review Comment:
   Should we use `exponentialBackoff.backoff(0)` as initial value? This seems 
to be what we do on successful requests and in `reset`.



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