Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple connections appear to be broken #48

Closed
toddtreece opened this issue Oct 20, 2021 · 5 comments · Fixed by #49
Closed

Multiple connections appear to be broken #48

toddtreece opened this issue Oct 20, 2021 · 5 comments · Fixed by #49
Labels
bug Something isn't working

Comments

@toddtreece
Copy link
Member

It seems like the default key is always replaced when NewDatasource is called, so it seems like the latest connection is always being used. I have a temp workaround for the issue here: https://github.com/grafana/snowflake-datasource/pull/98

It's unclear how this is intended to work or if this is related to the issue, but the query's q.ConnectionArgs variable is always nil.

Related issue: https://github.com/grafana/support-escalations/issues/999

@toddtreece toddtreece added the bug Something isn't working label Oct 20, 2021
@kminehart
Copy link
Collaborator

Ah so by using the same key for every NewDatasource, that causes setups with multiple Snowflake data sources to break in weird ways, as they're overwriting eachother?

@kminehart
Copy link
Collaborator

I think this could be pretty easily remedied by including the data source UID in the cache key there. This feature was specifically added to allow multiple connections in 1 data source in some AWS data sources. cc @sunker

@toddtreece
Copy link
Member Author

@kminehart yeah, exactly. they seem to all only be using one connection, and you can kind of reset which connection is being used if you go and do a health check on one of the data sources

This feature was specifically added to allow multiple connections in 1 data source

do you mean storing the connection in NewDatasource or storing the connection in getDB?

@andresmgot
Copy link
Collaborator

andresmgot commented Oct 22, 2021

I can confirm the issue (I was assuming that each datasource instance would have its own sqldatasource instance but it's not working that way). See the fix at #49.

@andresmgot
Copy link
Collaborator

fixed in v2.3.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants