private boolean appendsInProgress() {
        return appendsInProgress.get() > 0;
    }
Are there any threads currently appending messages?
clients/src/main/java/org/apache/kafka/clients/producer/internals/RecordAccumulator.java