public synchronized long timeToNextUpdate(long nowMs) {
        long timeToExpire = updateRequested() ? 0 : Math.max(this.lastSuccessfulRefreshMs + this.metadataExpireMs - nowMs, 0);
        return Math.max(timeToExpire, timeToAllowUpdate(nowMs));
    }
The next time to update the cluster info is the maximum of the time the current info will expire and the time the
current info can be updated (i.e. backoff time has elapsed). If an update has been requested, the metadata
expiry time is now.

@param nowMs current time in ms
@return remaining time in ms till updating the cluster info
clients/src/main/java/org/apache/kafka/clients/Metadata.java