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


##########
clients/src/main/java/org/apache/kafka/clients/NetworkClient.java:
##########
@@ -1123,6 +1133,17 @@ 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);
+
+            // Rebootstrap if needed and configured.
+            if (node == null && metadataRecoveryStrategy == 
MetadataRecoveryStrategy.REBOOTSTRAP) {

Review Comment:
   Ugh, that's correct. I'm sorry, I missed this case...
   
   I need to think how to pass this information to avoid rebootstrapping. 
Potentially introduce a variant of `leastLoadedNode` method, which will be 
called from two places where rebootstrapping is expected. It's result will have 
a flag indicating if any node is connected. The rest of the code base will use 
the current version.
   
   The necessity to implement this for the admin client, which is different 
from other clients, makes it a bit ugly :) 



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