public Optional<Node> findReadyBootstrapServer(long currentTimeMs) {
        // Check that there are no inflight requests across any of the known nodes not just
        // the bootstrap servers
        if (hasAnyInflightRequest(currentTimeMs)) {
            return Optional.empty();
        }

        int startIndex = random.nextInt(bootstrapServers.size());
        Optional<Node> result = Optional.empty();
        for (int i = 0; i < bootstrapServers.size(); i++) {
            int index = (startIndex + i) % bootstrapServers.size();
            Node node = bootstrapServers.get(index);

            if (isReady(node, currentTimeMs)) {
                result = Optional.of(node);
                break;
            }
        }

        return result;
    }
Returns a random bootstrap node that is ready to receive a request.

This method doesn't return a node if there is at least one request pending. In general this
method is used to send Fetch requests. Fetch requests have the invariant that there can
only be one pending Fetch request for the LEO.

@param currentTimeMs the current time
@return a random ready bootstrap node
raft/src/main/java/org/apache/kafka/raft/RequestManager.java