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 does not close in 0.5.13 #1862

Closed
phungleson opened this issue May 11, 2022 · 2 comments · Fixed by #1901
Closed

Connection does not close in 0.5.13 #1862

phungleson opened this issue May 11, 2022 · 2 comments · Fixed by #1901

Comments

@phungleson
Copy link

I am running tests and at beginning of test I have line like this.

let pool = PgPoolOptions::new()
        .max_connections(5)
        .connect(&url)
        .await
        .unwrap()
// clean up old database

And at the end of each test I have a line like this

pool.close().await;

First test runs well, but second tests onwards throw error that there is still connection when it tries to clean up old database

Everything runs well with 0.5.10.

This might be related to the issue: #1776.

@audunska
Copy link

I can confirm. We have a lot of tests, all of which runs a function to create a connection pool. After running cargo update which bumped sqlx (and sqlx-core) to 0.5.13, the number of DB connections started growing while churning through the tests, leading to test failures when we hit the connection limit.

Pinning the sqlx-core version to 0.5.11 fixes that.

@apognu
Copy link

apognu commented Jun 9, 2022

Related to #1824?

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 a pull request may close this issue.

3 participants