[Bug] Defaulting reuse_connections
to True
is breaking some users jobs
#1167
Labels
reuse_connections
to True
is breaking some users jobs
#1167
Is this a new bug in dbt-snowflake?
Current Behavior
We made connection reuse the default in #1109 - this is breaking some users jobs when they depend on thread session isolation. We should make reuse_connections opt-in instead of opt-out.
Expected Behavior
Make this behave the way they were prior to making
reuse_connections: True
by default.Steps To Reproduce
First, let's create a UDF to return the current session timezone - we will be using this in our model code later:
Make sure the account level timezone is
America/Los_Angeles
(Snowflakes default):Let's setup our
profiles.yml
:^ Key here being that neither of these keys
client_session_keep_alive
,reuse_connections
are set by the end user (dbt Cloud default profile).Now, let's setup our dbt project.
The idea here is that only model
a.sql
should operate on timezonePacific/Auckland
- and modelb.sql
should follow the account timezoneAmerica/Los_Angeles
.First we build using 1.8.latest:
^ So far so good. The session that built model
b
was independent of the session that built modela
- therefor changing the timezone on the session that built modela
did not affect modelb
.Now, we do a local install of dbt-snowflake from the main branch:
^
3fbc0749491f40d34014336457753b140e1fb1ee
is ahead of commit6857e6b800329a6490c3339824249c18b1af5eda
- which contains the commit that madereuse_connections
True
by default.^ Now things don't work so well anymore.
The session is shared and causes model b to no longer use the account timezone default.
Relevant log output
No response
Environment
Additional Context
In dbt Cloud, the debug logs show which commit of the adapter we are on. We have rolled forward and backward a few times this week.
As of this writing...
^ We are back on
e5b28d
- which is prior to commit6857e6
(the one that introduced this default).However, towards the end of last week, all throughout the weekend, we had been in a rolled forward state:
7fb454
being ahead of6857e6
- therefor some customers ran into this.dbt Cloud users probably want to do:
In their extended attributes so that this doesn't automatically get turned on for them by default (whenever we roll forward again but have not yet fixed this issue of
reuse_connections: True
by default).The text was updated successfully, but these errors were encountered: