private void maybeThrowInvalidGroupIdException() {
        if (!groupId.isPresent())
            throw new InvalidGroupIdException("To use the group management or offset commit APIs, you must " +
                    "provide a valid " + ConsumerConfig.GROUP_ID_CONFIG + " in the consumer configuration.");
    }
Release the light lock protecting the consumer from multi-threaded access.
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ClassicKafkaConsumer.java