code: public static void tryFailure(Promise<?> p, Throwable cause, InternalLogger logger) {
          if (!p.tryFailure(cause) && logger != null) {
              Throwable err = p.cause();
              if (err == null) {
                  logger.warn("Failed to mark a promise as failure because it has succeeded already: {}", p, cause);
              } else {
                  logger.warn(
                          "Failed to mark a promise as failure because it has failed already: {}, unnotified cause: {}",
                          p, ThrowableUtil.stackTraceToString(err), cause);
              }
          }
      }
docs: Try to mark the {@link Promise} as failure and log if {@code logger} is not {@code null} in case this fails.