Update clickhouse-test

This commit is contained in:
Alexander Tokmakov 2023-02-10 18:56:22 +03:00 committed by GitHub
parent 9e11f06e79
commit 681baa10b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -120,6 +120,7 @@ def clickhouse_execute_http(
if default_format is not None:
params["default_format"] = default_format
error_message = ""
for i in range(max_http_retries):
try:
client.request(
@ -130,8 +131,9 @@ def clickhouse_execute_http(
data = res.read()
break
except Exception as ex:
error_message += "\tAttempt {} failed: {}\n{}\n".format(i, str(ex), traceback.format_exc())
if i == max_http_retries - 1:
raise ex
raise Exception("Failed to send a request after {} retries:\n{}".format(max_http_retries, error_message))
sleep(i + 1)