public boolean hasAnyInflightRequest(long currentTimeMs) {
        boolean result = false;

        Iterator<ConnectionState> iterator = connections.values().iterator();
        while (iterator.hasNext()) {
            ConnectionState connection = iterator.next();
            if (connection.hasRequestTimedOut(currentTimeMs)) {
                // Mark the node as ready after request timeout
                iterator.remove();
            } else if (connection.isBackoffComplete(currentTimeMs)) {
                // Mark the node as ready after completed backoff
                iterator.remove();
            } else if (connection.hasInflightRequest(currentTimeMs)) {
                // If there is at least one inflight request, it is enough
                // to stop checking the rest of the connections
                result = true;
                break;
            }
        }

        return result;
    }
Returns true if there are any connections with pending requests.

This is useful for satisfying the invariant that there is only one pending Fetch request.
If there are more than one pending fetch request, it is possible for the follower to write
the same offset twice.

@param currentTimeMs the current time
@return true if the request manager is tracking at least one request
raft/src/main/java/org/apache/kafka/raft/RequestManager.java