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 failure leaves connection in an unusable state #82

Merged

Conversation

KPull
Copy link
Contributor

@KPull KPull commented Nov 3, 2023

When a query eventually made its way into the ExecuteContext, if establishing the connection raised an error within the __aenter__ section, the connection was not being cleared up. Subsequent queries to the same connection (in a pool) would state that the "previous query should be finished first."

In this pull request, we attempt to disconnect the connection (essentially doing the same thing __aexit__ does), marking it as stale within its associated pool, if the connection fails to be establish.

Thanks to @borgmatthew as well who helped with identifying the issue.

@itssimon
Copy link

This could potentially fix #93 too.

@long2ice mind taking a look at this?

@long2ice long2ice merged commit 229a3fb into long2ice:dev Feb 29, 2024
@long2ice
Copy link
Owner

Thanks!

@itssimon
Copy link

itssimon commented Mar 1, 2024

Thanks for merging this! If you get a chance, would you mind creating a new release so we can benefit from this fix?

@SaneBow
Copy link

SaneBow commented Apr 10, 2024

Nicely done! When can we have a new release available with this fix?

@tiejunhu
Copy link

Also expecting a new release for this fix

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.

5 participants