ClickHouseResponse retry(ClickHouseRequest<?> sealedRequest, ClickHouseException exception, int times) {
            for (int i = 1; i <= times; i++) {
                log.debug("Retry %d of %d due to: %s", i, times, exception.getMessage());
                // TODO retry idempotent query
                if (exception.getErrorCode() == ClickHouseException.ERROR_NETWORK) {
                    log.info("Retry request on %s due to connection issue", sealedRequest.getServer());
                    try {
                        return sendOnce(sealedRequest);
                    } catch (Exception exp) {
                        exception = ClickHouseException.of(exp.getCause() != null ? exp.getCause() : exp,
                                sealedRequest.getServer());
                    }
                }
            }

            throw new CompletionException(exception);
        }
Repeats sending same request until success, timed out or running into a
different error.

@param sealedRequest non-null sealed request
@param exception     non-null exception to start with
@param timeout       timeout in milliseconds, zero or negative numbers means
                     no repeat
@return non-null response
@throws CompletionException when error occurred or timed out
clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseClientBuilder.java