cmccabe commented on a change in pull request #10281: URL: https://github.com/apache/kafka/pull/10281#discussion_r597950877
########## File path: clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java ########## @@ -1089,29 +1106,63 @@ private long sendEligibleCalls(long now) { continue; } Node node = entry.getKey(); + if (!callsInFlight.getOrDefault(node.idString(), Collections.emptyList()).isEmpty()) { + log.trace("Still waiting for other calls to finish on node {}.", node); + nodeReadyDeadlines.remove(node); + continue; + } if (!client.ready(node, now)) { + Long deadline = nodeReadyDeadlines.get(node); + if (deadline != null) { + if (now >= deadline) { + log.info("Disconnecting from {} and revoking {} node assignment(s) " + + "because the node is taking too long to become ready.", + node.idString(), calls.size()); + transitionToPendingAndClearList(calls); + client.disconnect(node.idString()); + nodeReadyDeadlines.remove(node); + iter.remove(); + continue; + } + pollTimeout = Math.min(pollTimeout, deadline - now); Review comment: Let's just do that in the call to `NetworkClient#poll`. In general I agree that monotonic time would have been better (maybe this needs a rewrite...) -- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org