public static void attemptUntilTrue(
      BooleanSupplier condition, int maxAttempts, TimeDuration sleepTime, String name, Logger log)
      throws InterruptedException {
    Objects.requireNonNull(condition, "condition == null");
    attempt(
        () -> null,
        RetryPolicy.newBuilder()
            .setRetryHandler(ret -> !condition.getAsBoolean())
            .setWaitTime(sleepTime)
            .setMaxAttempts(maxAttempts)
            .build(),
        () -> name,
        log);
  }
Attempt indefinitely until the given {@param condition} holds or reaches {@param maxAttempts}
iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/ratis/utils/Retriable.java