private void printConsumeTimes(boolean force) {
        if (consumeTimes.size() > 0 && (force || consumeTimes.size() >= timePrintingThreshold)) {
            StringJoiner detailTimes = new StringJoiner(",");
            StringJoiner detailNums = new StringJoiner(",");
            long summaryTime = 0;
            int summaryNum = 0;
            try {
                for (Tuple2<Long, Integer> consumeTime : consumeTimes) {
                    Long time = consumeTime.f0;
                    Integer count = consumeTime.f1;
                    detailTimes.add(time + "");
                    detailNums.add(count + "");
                    summaryTime += time;
                    summaryNum += count;
                }
                consumeTimes.clear();

                LOG.info("Flushing time spent: [{}]:{}ms.",
                        detailTimes, ((double) summaryTime / summaryNum));
                LOG.info("Flushing records: [{}]", detailNums);
            } catch (Exception e) {
                LOG.error("error when print consumeTimes", e);
            }

        }
    }
The exception caught in asynchronous tasks.
inlong-sort/sort-flink/sort-flink-v1.13/sort-connectors/kudu/src/main/java/org/apache/inlong/sort/kudu/sink/KuduWriter.java