MichaCo / CacheManager

CacheManager is an open source caching abstraction layer for .NET written in C#. It supports various cache providers and implements many advanced features.
http://cachemanager.michaco.net
Apache License 2.0
2.33k stars 458 forks source link

Fixing concurrency issue in Memory Cache #266

Closed jkernsva closed 4 years ago

jkernsva commented 5 years ago

I'm seeing some System.IndexOutOfRangeException exceptions in our application caused by corruption of the child regions HashSet. This appears to be caused by concurrent writes to the data structure. I'm replacing the HashSet with a ConcurrentDictionary. This isn't ideal as each key also has to store a bogus value, but there is no builtin concurrent HashSet and this seemed to be a better solution than explicit locking.

DamianKedzior commented 4 years ago

Hi @MichaCo, do you have plan to merge this PR and release it? Does it requires some additional testing? Could community help somehow with this?

MichaCo commented 4 years ago

Hey, I'm sorry that this is still not merged. A lot of stuff going on right now...

But, I'll try to find some time and get a new release out with this and some other minor things as soon™ as I can

tynorton commented 4 years ago

When can we get an updated NuGet with this fix? Problem is affecting us.

pergardebrink commented 3 years ago

We hit the problem as well with the same exception (tried to move to this because of https://github.com/MichaCo/CacheManager/issues/313).

Is it possible to get a new release of 1.x? Or the 2.0 with netstandard2.0 support for System.RuntimeCaching? Can I/we help out in any way?

pergardebrink commented 3 years ago

Just wondering if there's anything I can do to help with getting this out into 1.2 or 2.0 in some way?

I'm trying to move some stuff from .NET Framework to .NET Core/.NET 5 and got stuck in between this issue here and #313 .. Or is there any other way of getting a memory cache in CacheManager when targeting .NET Core/._NET 5?

NinjaCross commented 2 years ago

Are there news about this ? This is impacting heavily multiple applications of my customers.