You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given a snowflake environment with client_session_keepalive set to True, the run_sql RPC call will successfully run and then never finish. This manifests as the rpc poll call showing the task as still running, forever.
The process will show up in the process table and the RPC server's ps output as being active on the OS level, but it won't be actually doing anything. In particular it'll be blocking on join()ing the process.
The problem here is that the background thread that the snowflake connector starts is hanging, because dbt never calls close() on the handle. The fix is to update dbt.adapters.base.connections.ConnectionManager.release() to always call close(), even when the connection state is "open" (currently it only calls it if the state is not "open", which seems pretty silly).
Steps To Reproduce
set up a profile with client_session_keepalive: true
run dbt rpc and point it at that profile
call run_sql with select 1 as id as the argument, or anything else you like
wait forever
Expected behavior
The API call should return pretty much immediately.
Screenshots and log output
N/A
System information
Which database are you using dbt with?
postgres
redshift
bigquery
snowflake
other (specify: ____________)
The output of dbt --version: dbt==0.17.1
The operating system you're using:
macos or linux
The output of python --version:
Any? 3.6 and 3.8 both have it.
Additional context
I was able to reproduce this behavior on macos with dbt 0.17.0, but not on Linux, so I assume it has to do with some oddity of spawn vs fork behavior.
The text was updated successfully, but these errors were encountered:
Describe the bug
Given a snowflake environment with
client_session_keepalive
set to True, therun_sql
RPC call will successfully run and then never finish. This manifests as the rpcpoll
call showing the task as still running, forever.The process will show up in the process table and the RPC server's
ps
output as being active on the OS level, but it won't be actually doing anything. In particular it'll be blocking on join()ing the process.The problem here is that the background thread that the snowflake connector starts is hanging, because dbt never calls
close()
on the handle. The fix is to updatedbt.adapters.base.connections.ConnectionManager.release()
to always callclose()
, even when the connection state is "open" (currently it only calls it if the state is not "open", which seems pretty silly).Steps To Reproduce
client_session_keepalive: true
dbt rpc
and point it at that profilerun_sql
withselect 1 as id
as the argument, or anything else you likeExpected behavior
The API call should return pretty much immediately.
Screenshots and log output
N/A
System information
Which database are you using dbt with?
The output of
dbt --version
:dbt==0.17.1
The operating system you're using:
macos or linux
The output of
python --version
:Any? 3.6 and 3.8 both have it.
Additional context
I was able to reproduce this behavior on macos with dbt 0.17.0, but not on Linux, so I assume it has to do with some oddity of spawn vs fork behavior.
The text was updated successfully, but these errors were encountered: