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

Connections leak with SqlDistributedLockConnectionStrategy.Azure #14

Closed
zavalita1 opened this issue Jan 10, 2018 · 2 comments
Closed

Connections leak with SqlDistributedLockConnectionStrategy.Azure #14

zavalita1 opened this issue Jan 10, 2018 · 2 comments
Labels

Comments

@zavalita1
Copy link

SqlDistributedLock.Try aquired with Azure strategy creates instance of AzureSqlDistributedLock and invokes it's TryAquire/TryAquireAsync with no contextHandle argument thus opening a new connection using provided connectionString. However when the lock is released and component is disposed, connection opened by it is not disposed thus leading to a connecion leakage.

Since outside connection vs. opening new connection case is determined anyway by keeping "ownsKeepalive" field way to go could be passing an connection instance to the LockScope if connection is being opened and having it disposed together with LockScope instance.

@madelson madelson added the bug label Jan 11, 2018
@madelson
Copy link
Owner

Thanks for reporting @zavalita1. I am currently working on the next version of the library and I will incorporate a fix for this with that release.

@madelson
Copy link
Owner

madelson commented Feb 8, 2018

This is fixed as of version 1.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants