private void updateGroupSubscription(Set<String> topics) {
        // the leader will begin watching for changes to any of the topics the group is interested in,
        // which ensures that all metadata changes will eventually be seen
        if (this.subscriptions.groupSubscribe(topics))
            metadata.requestUpdateForNewTopics();

        // update metadata (if needed) and keep track of the metadata used for assignment so that
        // we can check after rebalance completion whether anything has changed
        if (!client.ensureFreshMetadata(time.timer(Long.MAX_VALUE)))
            throw new TimeoutException();

        maybeUpdateSubscriptionMetadata();
    }
Return the time to the next needed invocation of {@link ConsumerNetworkClient#poll(Timer)}.
@param now current time in milliseconds
@return the maximum time in milliseconds the caller should wait before the next invocation of poll()
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinator.java