dotnet/runtime
GitHub で見るPossible thread safety issue with linked cache entries
Open
#46,032 opened on 2020年12月14日
area-Extensions-Cachingbughelp wanted
Repository metrics
- Stars
- (17,886 stars)
- PR merge metrics
- (平均マージ 12d 11h) (30d で 661 merged PRs)
説明
As noticed by @gfoidl in https://github.com/dotnet/runtime/pull/45962/files#r541573802
It's possible that when the following code responsible for propagating the options to the linked cache entry:
calls the parent.AddExpirationToken method:
is using _expirationTokens which might be used without a lock in the CheckForExpiredTokens method at the same time
Adding a lock to CheckForExpiredTokens would be trivial, but it would hurt the perf...