boolean flushInProgress() {
        return flushesInProgress.get() > 0;
    }
Are there any threads currently waiting on a flush?

package private for test
clients/src/main/java/org/apache/kafka/clients/producer/internals/RecordAccumulator.java