private void checkZombieTsFileWriter() {
      pipeConsensusTsFileWriterPool.stream()
          .filter(PipeConsensusTsFileWriter::isUsed)
          .forEach(
              writer -> {
                if (System.currentTimeMillis() - writer.lastUsedTs
                    >= IOTDB_CONFIG.getTsFileWriterZombieThreshold()) {
                  try {
                    writer.closeSelf(consensusPipeName);
                    writer.returnSelf(consensusPipeName);
                    LOGGER.info(
                        "PipeConsensus-PipeName-{}: tsfile writer-{} is cleaned up because no new requests were received for too long.",
                        consensusPipeName,
                        writer.index);
                  } catch (IOException | DiskSpaceInsufficientException e) {
                    LOGGER.warn(
                        "PipeConsensus-PipeName-{}: receiver watch dog failed to return tsFileWriter-{}.",
                        consensusPipeName.toString(),
                        writer.index,
                        e);
                  }
                }
              });
    }
This method cannot be set to synchronize. Receive events can be concurrent since reqBuffer but
load event must be synchronized.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/protocol/pipeconsensus/PipeConsensusReceiver.java