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

Connection should close if there was an error executing the query #162

Open
leoskyrocker opened this issue Oct 20, 2023 · 0 comments
Open
Labels

Comments

@leoskyrocker
Copy link

leoskyrocker commented Oct 20, 2023

Describe the bug
Currently, we're only closing the connection after executing a query if the keep_connected flag is set to false. However, if there is a connection error while executing the query, the query-exporter won't be able to re-use a connection subsequently, and hence it will continue to error out if keep_connected is configured to true.

Closing the connection is expected after after the query execution if there has been an exception.

A simple fix is to close the connection in the exception block (any exceptions).
A more proper fix is to close the connection if the exception is related to a connection error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant