Skip to content

Commit

Permalink
Give each redshift client their own boto session
Browse files Browse the repository at this point in the history
since the boto session is not thread-safe, using the default session in a multi-threaded scenario will result in concurrency errors
  • Loading branch information
jweibel22 committed Sep 18, 2020
1 parent 8357e51 commit 34388a6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plugins/redshift/dbt/adapters/redshift/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ def fetch_cluster_credentials(cls, db_user, db_name, cluster_id,
must already exist in the database, or else an error will occur"""

if iam_profile is None:
boto_client = boto3.client('redshift')
session = boto3.Session()
boto_client = session.client("redshift")
else:
logger.debug("Connecting to Redshift using 'IAM'" +
f"with profile {iam_profile}")
Expand Down

0 comments on commit 34388a6

Please sign in to comment.