@Override
    public RuntimeException handleFault(String failureMessage, Throwable cause) {
        if (cause == null) {
            log.error("Encountered fatal fault: {}", failureMessage);
        } else {
            log.error("Encountered fatal fault: {}", failureMessage, cause);
        }

        try {
            action.run();
        } catch (Throwable e) {
            log.error("Failed to run terminating action.", e);
        }

        int statusCode = 1;
        if (shouldHalt) {
            Exit.halt(statusCode);
        } else {
            Exit.exit(statusCode);
        }

        return null;
    }
This is a fault handler which terminates the JVM process.
server-common/src/main/java/org/apache/kafka/server/fault/ProcessTerminatingFaultHandler.java