public static boolean isRetriableClientGssException(Exception exception) {
        Throwable cause = exception.getCause();
        while (cause != null && !(cause instanceof GSSException)) {
            cause = cause.getCause();
        }
        if (cause != null) {
            GSSException gssException = (GSSException) cause;
            return gssException.getMajor() == GSSException.NO_CRED;
        }
        return false;
    }
Returns true if the exception should be handled as a transient failure on clients.
We handle GSSException.NO_CRED as retriable on the client-side since this may
occur during re-login if a clients attempts to authentication after logout, but
before the subsequent login.
clients/src/main/java/org/apache/kafka/common/security/kerberos/KerberosError.java