public static boolean isTimeoutException(Throwable exception) {
        if (exception == null) return false;
        if (exception instanceof ExecutionException) {
            exception = exception.getCause();
            if (exception == null) return false;
        }
        return exception instanceof TimeoutException;
    }
Check if an exception is a normal timeout exception.

@param exception     The exception to check.
@return              True if the exception is a timeout exception.
metadata/src/main/java/org/apache/kafka/controller/errors/ControllerExceptions.java