Skip to content

Set client state to idle after error #179

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

Merged
merged 4 commits into from
Sep 24, 2022

Conversation

drdrsh
Copy link
Collaborator

@drdrsh drdrsh commented Sep 24, 2022

If clients fail to checkout a connection from the pool or lose a connection they had, we don't change the state of the client so it will be stuck in state active or waiting. This state is not persistent as the client state will be corrected the next time the client attempts to perform a query.

This PR fixes this by setting client state to idle after errors. It also adds tests that cover that case.

@drdrsh drdrsh marked this pull request as ready for review September 24, 2022 04:08
@levkk
Copy link
Contributor

levkk commented Sep 24, 2022

Neat!

@levkk levkk merged commit af064ef into postgresml:main Sep 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants