ivanyu commented on code in PR #13277:
URL: https://github.com/apache/kafka/pull/13277#discussion_r1636337120


##########
clients/src/main/java/org/apache/kafka/clients/NetworkClient.java:
##########
@@ -1121,13 +1140,25 @@ public long maybeUpdate(long now) {
 
             // Beware that the behavior of this method and the computation of 
timeouts for poll() are
             // highly dependent on the behavior of leastLoadedNode.
-            Node node = leastLoadedNode(now);
-            if (node == null) {
+            LeastLoadedNode leastLoadedNode = leastLoadedNode(now);
+
+            // Rebootstrap if needed and configured.
+            if (!leastLoadedNode.hasNodeAvailableOrConnectionReady()
+                    && metadataRecoveryStrategy == 
MetadataRecoveryStrategy.REBOOTSTRAP) {

Review Comment:
   As it's only comparisons inside the method, performance-wise it doesn't 
matter much. However, it's more logical. Done this.



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