@SuppressWarnings("java:S899")
  public void addFailureEventToRetryQueue(final EnrichedEvent event) {
    if (event.isReleased()) {
      return;
    }

    if (isClosed.get()) {
      event.clearReferenceCount(PipeConsensusAsyncConnector.class.getName());
      return;
    }
    // just in case
    if (retryEventQueue.contains(event)) {
      return;
    }

    retryEventQueue.offer(event);
    LOGGER.info(
        "PipeConsensus-ConsensusGroup-{}: Event {} transfer failed, will be added to retry queue.",
        consensusGroupId,
        event);

    if (isClosed.get()) {
      event.clearReferenceCount(PipeConsensusAsyncConnector.class.getName());
    }
  }
Add failure event to retry queue.

@param event event to retry
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/connector/protocol/pipeconsensus/PipeConsensusAsyncConnector.java