public void raise(RuntimeException e) {
        try {
            if (e == null)
                throw new IllegalArgumentException("The exception passed to raise must not be null");

            if (!result.compareAndSet(INCOMPLETE_SENTINEL, e))
                throw new IllegalStateException("Invalid attempt to complete a request future which is already complete");

            fireFailure();
        } finally {
            completedLatch.countDown();
        }
    }
Raise an exception. The request will be marked as failed, and the caller can either
handle the exception or throw it.
@param e corresponding exception to be passed to caller
@throws IllegalStateException if the future has already been completed
clients/src/main/java/org/apache/kafka/clients/consumer/internals/RequestFuture.java