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

Race condition in MemoryCacheMethod #3

Closed
Archomeda opened this issue Jun 17, 2019 · 0 comments
Closed

Race condition in MemoryCacheMethod #3

Archomeda opened this issue Jun 17, 2019 · 0 comments
Assignees
Labels
Area: Web cache Related to the web API caching Duration: Short Less than 2 hours of estimated work Priority: Medium Medium priority Resolution: Fixed The issue has been fixed Type: Bug Something isn't working

Comments

@Archomeda
Copy link
Owner

I overlooked the possible race condition in the garbage collector in MemoryCacheMethod that might happen if it wants to delete at least 2 of the same keys from the ConcurrentDictionary at the same time. While .TryRemove(...) is thread-safe, the code around it is not. Meaning that if the key is already deleted, the other thread will fall in an infinite loop because it fails to delete it (because it doesn't exist anymore).

@Archomeda Archomeda added Type: Bug Something isn't working Status: Ready Work is accepted and is planned for a future release Priority: Medium Medium priority Duration: Short Less than 2 hours of estimated work Area: Web cache Related to the web API caching labels Jun 17, 2019
@Archomeda Archomeda self-assigned this Jun 17, 2019
@Archomeda Archomeda added Status: In progress This is being worked on and removed Status: Ready Work is accepted and is planned for a future release labels Jun 17, 2019
@Archomeda Archomeda added Resolution: Fixed The issue has been fixed and removed Status: In progress This is being worked on labels Jun 17, 2019
Archomeda added a commit that referenced this issue Jun 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Web cache Related to the web API caching Duration: Short Less than 2 hours of estimated work Priority: Medium Medium priority Resolution: Fixed The issue has been fixed Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant