static boolean exceptionIsFatal(final Throwable exception) {
    final boolean
        securityException =
        exception instanceof AuthenticationException
            || exception instanceof AuthorizationException
            || exception instanceof SecurityDisabledException;

    final boolean
        communicationException =
        exception instanceof InvalidTopicException
            || exception instanceof UnknownServerException
            || exception instanceof SerializationException
            || exception instanceof OffsetMetadataTooLarge
            || exception instanceof IllegalStateException;

    return securityException || communicationException;
  }
Check if the exception is Non-Retriable there a show stopper all we can do is clean and exit.
@param exception input exception object.
@return true if the exception is fatal thus we only can abort and rethrow the cause.
kafka-handler/src/java/org/apache/hadoop/hive/kafka/KafkaUtils.java