public void rmvAllExpiredRecords() {
        long curTime = System.currentTimeMillis();
        Set<String> expiredAddrs = new HashSet<>();
        for (Map.Entry<String, RemoteConErrStats> entry : remoteAddrMap.entrySet()) {
            if (entry.getKey() == null || entry.getValue() == null) {
                continue;
            }
            if (entry.getValue().isExpiredRecord(curTime)) {
                expiredAddrs.add(entry.getKey());
            }
        }
        if (!expiredAddrs.isEmpty()) {
            for (String tmpAddr : expiredAddrs) {
                RemoteConErrStats rmtConErrStats =
                        remoteAddrMap.get(tmpAddr);
                if (rmtConErrStats == null) {
                    continue;
                }
                if (rmtConErrStats.isExpiredRecord(curTime)) {
                    remoteAddrMap.remove(tmpAddr);
                }
            }
        }
        expiredAddrs.clear();
        curTime = System.currentTimeMillis();
        for (Map.Entry<String, Long> entry : forbiddenAddrMap.entrySet()) {
            if (entry.getKey() == null || entry.getValue() == null) {
                continue;
            }
            if ((curTime - entry.getValue()) > (linkStatsForbiddenDurMs + 60000)) {
                expiredAddrs.add(entry.getKey());
            }
        }
        if (!expiredAddrs.isEmpty()) {
            for (String tmpAddr : expiredAddrs) {
                Long recordTime = forbiddenAddrMap.get(tmpAddr);
                if (recordTime == null) {
                    continue;
                }
                if ((curTime - recordTime) > (linkStatsForbiddenDurMs + 60000)) {
                    forbiddenAddrMap.remove(tmpAddr);
                }
            }
        }
    }
Remove expired records
All forbidden records will be removed after the specified time
inlong-tubemq/tubemq-core/src/main/java/org/apache/inlong/tubemq/corerpc/RpcServiceFactory.java