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 f1af611
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
### Under the hood
- Add changelog, issue templates ([#119](https://github.com/fishtown-analytics/dbt-spark/pull/119), [#120](https://github.com/fishtown-analytics/dbt-spark/pull/120))

### Fixes
- Handle case of 0 retries better for HTTP Spark Connections ([#132](https://github.com/fishtown-analytics/dbt-spark/pull/132))

### Contributors
- [@danielvdende](https://github.com/danielvdende) ([#132](https://github.com/fishtown-analytics/dbt-spark/pull/132))

## dbt-spark 0.18.1.1 (November 13, 2020)

### Fixes
Expand Down
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 f1af611

Please sign in to comment.