Skip to content

Commit

Permalink
Handle case of 0 connect retries better
Browse files Browse the repository at this point in the history
With a default of 0 connect_retries, confusing log messages show up.
The logs suggest that a retry is going to be carried out, but it isn't.
Also, a sleep is carried out, even if no retries are to happen. This
check prevents this from happening.
  • Loading branch information
danielvdende committed Dec 23, 2020
1 parent 04e1fb9 commit 3937921
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dbt/adapters/spark/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ def open(cls, connection):
msg += ', is your token valid?'
raise dbt.exceptions.FailedToConnectException(msg) from e
retryable_message = _is_retryable_error(e)
if retryable_message:
if retryable_message and creds.connect_retries > 0:
msg = (
f"Warning: {retryable_message}\n\tRetrying in "
f"{creds.connect_timeout} seconds "
Expand Down

0 comments on commit 3937921

Please sign in to comment.