-
Notifications
You must be signed in to change notification settings - Fork 803
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
Too many open connections with NpgSql 7.0.0 #1993
Comments
Experiencing the same thing. Seems to be due to an introduction of DbDataSource abstraction in .NET 7 (details here) and According to It's a rather unpleasant surprise, I'd (perhaps, naively) expect them to be pooled under the hood. My workaround was to create a data source, stick it as a singleton into DI and use |
OK, got it. Need time to think how to deal with it. |
I encountered the same issue and used the same overload as @tyshkavets for the fix, but without explicit singleton registration: |
Hi,
|
I would be happy to provide a fix and include it in the 8.0 version. Is my understanding correct that the current API design leads the users into a trap of creating a new instance of |
I can get the fix and move down to 6.X and current 7.X versions! |
7.1.0 works fine, closed. |
What happened: upgraded from 6.0.2 to 7.0.0 and 1 application instance opens ~40 connections towards the database which cause issues as the number of connections are limited, with the old version it has opened ~2 connections.
What you expected to happen: should not have this many connection opened and left dangling.
How to reproduce it: grab an application (checked with .NET 7 and 8 Preview) add this package and start running the health checks.
Source code sample: no special code is required, plain vanilla ASP.NET health check setup.
Environment:
The text was updated successfully, but these errors were encountered: