public boolean awaitMetadataUpdate(Timer timer) {
        int version = this.metadata.requestUpdate(false);
        do {
            poll(timer);
        } while (this.metadata.updateVersion() == version && timer.notExpired());
        return this.metadata.updateVersion() > version;
    }
Block waiting on the metadata refresh with a timeout.

@return true if update succeeded, false otherwise.
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerNetworkClient.java