-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
fix postgresql connection leak #2611
fix postgresql connection leak #2611
Conversation
My changes to pgx to avoid this issue entirely have been given the okay. Once they are merged I will update this PR. |
ddaedbe
to
1a5cc39
Compare
updated PR using fix in the driver. |
@@ -79,21 +75,3 @@ func ParseURL(uri string) (string, error) { | |||
sort.Strings(kvs) // Makes testing easier (not a performance concern) | |||
return strings.Join(kvs, " "), nil | |||
} | |||
|
|||
func Connect(address string) (*sql.DB, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is used by the postgresql_extensible
input, can you flip through that plugin and make sure its working and connecting in the correct way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, I added the connect method originally. I'm just fixing the regression for the code I commited. You'll notice I changed postgresql_extensible as well in the diff.
Thanks for the review. =)
Can we connect to Redshift using this plugin? |
@anilkulkarni87 I think so, but I have never tried, you could ask over on the InfluxData Community site. |
@danielnelson I have been trying to connect. but doesnt connect to Redshift though. Let me tryasking in the community. |
@anilkulkarni87 its not intended to. so short answer is no =) |
@james-lawrence Thought so after going through the .Go script. But do you know if there are any plugins which can connect to redshift? |
no idea, doesn't look like. You'll likely have to write one. |
@anilkulkarni87 You can create a feature request issue, make sure to include what happens if you try to use the existing postgres inputs. |
@danielnelson created a feature request issue |
fixes #2410
the connection leak caused by how pgx manages connection pools and how telegraf connects to generate the sql.DB connection. We needed to close the pool in addition to the db connection.
I've patched pgx to handle both DSN and URI based connection strings natively. this fixes the issue.