code: void fail(Throwable cause, boolean complete) {
          if (cause != null) {
              Throwable e = this.failureCause.get();
              if (e != null && e != cause) {
                  cause.addSuppressed(e);
              }
  
              this.failureCause.set(cause);
          }
  
          endAttempt();
          WriteLedger ledger = this.writeLedger.get();
          if (ledger != null && ledger.isRolledOver()) {
              // Rollovers aren't really failures (they're caused by us). In that case, do not count this failure as an attempt.
              this.attemptCount.updateAndGet(v -> Math.max(0, v - 1));
          }
  
          if (complete) {
              this.result.completeExceptionally(this.failureCause.get());
          }
      }
docs: Indicates that this write failed.
  
  @param cause    The failure cause. If null, the previous failure cause is preserved.
  @param complete If true, the externalCompletion will be immediately be completed with the current failure cause.
  If false, no completion will be done.