public boolean awaitPendingRequests(Node node, Timer timer) {
        while (hasPendingRequests(node) && timer.notExpired()) {
            poll(timer);
        }
        return !hasPendingRequests(node);
    }
Block until all pending requests from the given node have finished.
@param node The node to await requests from
@param timer Timer bounding how long this method can block
@return true If all requests finished, false if the timeout expired first
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerNetworkClient.java