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

Clear lock on exception in disk cache GetAsync, ignore _Lock keys on Init() #529

Merged
merged 3 commits into from
Apr 17, 2024
Merged

Clear lock on exception in disk cache GetAsync, ignore _Lock keys on Init() #529

merged 3 commits into from
Apr 17, 2024

Conversation

dplarina
Copy link
Contributor

Fixes #523

If the implementation's dataRetriever() throws an exception, the relevant cache key stays locked and will never recover. This removes the lock if there is an exception.

Also when the disk cache provider is initialized, added ignoring existing _Lock keys for situations where the app crashed or was restarted while the Lock was saved to the keys.dat.

@catcherwong catcherwong requested a review from Memoyu April 16, 2024 00:56
@Memoyu
Copy link
Contributor

Memoyu commented Apr 16, 2024

image

Hello, there are some problems when running unit tests. Please adjust them. Thank you for your PR.

@dplarina
Copy link
Contributor Author

Sorry. I can't even find the relevant test to begin to know how to troubleshoot that.

Also the failure appears be happening in code unrelated to the code change. I assume this test is ensuring that multiple threads can access the cached value (cache hits), while the code change is related to cache misses.

@catcherwong
Copy link
Member

All CI check have passed. @Memoyu

@Memoyu Memoyu enabled auto-merge (squash) April 17, 2024 01:38
@Memoyu Memoyu merged commit 3f6835c into dotnetcore:dev Apr 17, 2024
3 checks passed
@dplarina dplarina deleted the fix-disk-lock-handling branch April 17, 2024 13:59
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.

Rare stack overflow error in EasyCaching.Disk
3 participants