Skip to content

Commit

Permalink
Merge branch 'master' into close-scheduler-producer
Browse files Browse the repository at this point in the history
  • Loading branch information
lynnagara authored Dec 16, 2021
2 parents 9ec24f6 + bb441ad commit 27423b1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions snuba/clickhouse/native.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ def execute_robust(
attempts, (infinite in the case of too many simultaneous queries
errors) and wait a second between retries.
This is used by the writer, which needs to either complete its current
write successfully or else quit altogether. Note that each retry in this
This is by components which need to either complete their current
query successfully or else quit altogether. Note that each retry in this
loop will be doubled by the retry in execute()
"""
attempts_remaining = 3
Expand All @@ -168,7 +168,7 @@ def execute_robust(
except (errors.NetworkError, errors.SocketTimeoutError, EOFError) as e:
# Try 3 times on connection issues.
logger.warning(
"Write to ClickHouse failed: %s (%d tries left)",
"ClickHouse query execution failed: %s (%d tries left)",
str(e),
attempts_remaining,
)
Expand All @@ -181,7 +181,9 @@ def execute_robust(
time.sleep(1)
continue
except errors.ServerException as e:
logger.warning("Write to ClickHouse failed: %s (retrying)", str(e))
logger.warning(
"ClickHouse query execution failed: %s (retrying)", str(e)
)
if e.code == errors.ErrorCodes.TOO_MANY_SIMULTANEOUS_QUERIES:
# Try forever if the server is overloaded.
sleep_seconds = state.get_config(
Expand Down

0 comments on commit 27423b1

Please sign in to comment.