in flink-connector-elasticsearch-base/src/main/java/org/apache/flink/connector/elasticsearch/sink/ElasticsearchWriter.java [129:137]
public void flush(boolean endOfInput) throws IOException, InterruptedException {
checkpointInProgress = true;
while (pendingActions != 0 && (flushOnCheckpoint || endOfInput)) {
bulkProcessor.flush();
LOG.info("Waiting for the response of {} pending actions.", pendingActions);
mailboxExecutor.yield();
}
checkpointInProgress = false;
}