ahuang98 commented on code in PR #19658:
URL: https://github.com/apache/kafka/pull/19658#discussion_r2082083752


##########
raft/src/main/java/org/apache/kafka/raft/KafkaRaftClient.java:
##########
@@ -1048,14 +1053,18 @@ private void maybeHandleElectionLoss(NomineeState 
state, long currentTimeMs) {
         }
     }
 
-    private int binaryExponentialElectionBackoffMs(int retries) {
+    // visible for testing
+    static int binaryExponentialElectionBackoffMs(int backoffMaxMs, int 
retries, Random random) {

Review Comment:
   nice find! looks like we could use that to accomplish something very 
similar. unfortunately it looks like that class has the same issue where at 
some point it becomes statistically likely that the backoff returned is capped 
to a static value. this is probably fine for most cases and fixing this would 
be a more widespread change that I'm not comfortable making in this PR.
   
   btw, this issue should only affect the pre-KIP-996 world. after this is 
merged and cherry-picked to older releases, I will open a new PR to remove this 
exponential backoff completely



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