-
Notifications
You must be signed in to change notification settings - Fork 38
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
Fixes key locking issues #155
base: master
Are you sure you want to change the base?
Fixes key locking issues #155
Conversation
Fixed, @Kukks @NicolasDorier! |
private static readonly AsyncDuplicateLock _locker = new(); | ||
private static readonly AsyncKeyedLocker<string> _locker = new(o => | ||
{ | ||
o.PoolSize = 20; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need these settings? Does this restrict to only 20 concurrent locks?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, the pooling is there to improve performance and reduce memory allocations by reusing objects. In case the pool is empty, an object is created. The pool is thus not a restriction.
@MarkCiliaVincenti hey, I prefer we don't get a third party dependency for this, can you just copy the relevant classes. |
I would need to copy most classes in here, and then what, update this project whenever I update my library? I don't understand what benefit you believe you will get from using 3rd party classes as opposed to a 3rd party dll. If the reason is security, you can step into and debug the code in the NuGet package as I enabled that functionality, which allows you to confirm that what you see in the source code is the same as what is in the DLL. |
Do you want this PR closed? |
Fixes race condition mentioned in #148 and also a potential issue when token is cancelled not releasing semaphore during
await Task.Delay(2500, _cts.Token);
possibly causing issues.