private synchronized void persistProgressIndex() {
    if (lastPersistCount.get() == updateCount.get()) {
      // in case of multiple threads calling updateProgressIndex at the same time
      return;
    }

    try (final PublicBAOS byteArrayOutputStream = new PublicBAOS();
        final DataOutputStream outputStream = new DataOutputStream(byteArrayOutputStream)) {
      progressIndex.get().serialize(outputStream);
      // append is false by default.
      FileUtils.writeByteArrayToFile(
          progressIndexPersistFile,
          byteArrayOutputStream.getBuf(),
          0,
          byteArrayOutputStream.size());
      lastPersistCount.set(updateCount.get());
    } catch (IOException e) {
      LOGGER.warn("Failed to persist progress index {} for {}", progressIndex.get(), this, e);
    }
  }
Stores the exceptions encountered during run time of each pipe task.

<p>The exceptions are instances of {@link PipeRuntimeCriticalException}, {@link
PipeRuntimeConnectorCriticalException} and {@link PipeRuntimeNonCriticalException}.

<p>The failure of them, respectively, will lead to the stop of the pipe, the stop of the pipes
sharing the same connector, and nothing.
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/agent/task/meta/PipeTaskMeta.java