Repository navigation
Fix connection leak in NpgsqlDatabaseCreator.Exists - #1813
Merged
Merged
Conversation
roji
enabled auto-merge (squash)
April 17, 2021 17:37
This was referenced Apr 17, 2021
roji
added a commit
that referenced
this pull request
Apr 17, 2021
Member
Author
|
Backported to 5.0.6 via 4213899 |
|
I can confirm that this fix resolves #1812 . Thanks! |
Member
Author
|
Thanks for testing and reporting @frabe1579! You can use that CI package until 5.0.6 comes out (which shouldn't be on too long). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1812
This is a workaround; the root issue here is that NpgsqlRelationalConnection.CloneWith returns an instance with _connectionOwned=false, since the NpgsqlConnection is externally-provided. This means that disposing the NpgsqlRelationalConnection does not close/dispose the NpgsqlConnection, hence the leak.
Ideally CloneWith should return an instance with _connectionOwned=true.