public void checkFailedData() {
        LOGGER.info("Audit failed cache size: {}", failedDataMap.size());

        Iterator<Map.Entry<Long, AuditData>> iterator = failedDataMap.entrySet().iterator();
        while (iterator.hasNext()) {
            Map.Entry<Long, AuditData> entry = iterator.next();
            if (sendData(entry.getValue().getDataByte())) {
                iterator.remove();
                sleep();
            }
        }
        if (failedDataMap.isEmpty()) {
            checkAuditFile();
        }

        long failedDataSize = getFailedDataSize();
        globalAuditMemory.addAndGet(failedDataSize);

        if (failedDataMap.size() > auditConfig.getMaxCacheRow()
                || globalAuditMemory.get() > maxGlobalAuditMemory) {
            LOGGER.warn("Failed cache [size: {}, threshold {}], [count {}, threshold: {}]",
                    globalAuditMemory.get(), maxGlobalAuditMemory,
                    failedDataMap.size(), auditConfig.getMaxCacheRow());

            writeLocalFile();

            failedDataMap.clear();
        }

        globalAuditMemory.addAndGet(-failedDataSize);
    }
Clean up the backlog of unsent message packets
inlong-audit/audit-sdk/src/main/java/org/apache/inlong/audit/send/SenderManager.java