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.dropDatabase() leaks an unreleased db client #3727

Merged
merged 1 commit into from
Mar 1, 2019

Conversation

mwilniewiec
Copy link
Contributor

QueryRunner in Connection.dropDatabase() must be released similarly to Connection.query() method.

try {
...
} finally {
    queryRunner.release()
}

I had a situation where no more queries could be done because I had 10 clients leaked in the query pool.
In my case dropDatabase() method failed because of a deadlock in postgres, this caused no release() to be called. Postgres Pool has a default of max 10 connections. When all 10 connections were failed dropDatabase calls (not released), no more queries could be performed and hanged forever.

@pleerock pleerock merged commit e2e9118 into typeorm:master Mar 1, 2019
@pleerock
Copy link
Member

pleerock commented Mar 1, 2019

Thank you!

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.

None yet

2 participants