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

fix: add thread safety to TryLookup by locking _storeLock #130

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

abstratovcm
Copy link

@abstratovcm abstratovcm commented Oct 4, 2024

This commit addresses an intermittent error that occurs in the FixedCache.TryLookup method when multiple threads access it simultaneously. The error was caused by wrappedEntry being null due to race conditions. To fix this, a lock (_storeLock) was added around the TryLookup method to ensure thread-safe access, similar to other parts of the code that already use this locking mechanism.

Closes #129.

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

Successfully merging this pull request may close these issues.

"Object reference not set to an instance of an object" Error in FixedCache.TryLookup
1 participant