Skip to content

Commit 3937921

Browse files
committed
Handle case of 0 connect retries better
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.
1 parent 04e1fb9 commit 3937921

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

dbt/adapters/spark/connections.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ def open(cls, connection):
401401
msg += ', is your token valid?'
402402
raise dbt.exceptions.FailedToConnectException(msg) from e
403403
retryable_message = _is_retryable_error(e)
404-
if retryable_message:
404+
if retryable_message and creds.connect_retries > 0:
405405
msg = (
406406
f"Warning: {retryable_message}\n\tRetrying in "
407407
f"{creds.connect_timeout} seconds "

0 commit comments

Comments
 (0)