private void acquireAndEnsureOpen() {
        acquire();
        if (this.closed) {
            release();
            throw new IllegalStateException("This consumer has already been closed.");
        }
    }
Acquire the light lock and ensure that the consumer hasn't been closed.

@throws IllegalStateException If the consumer has been closed
clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java