You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 14, 2018. It is now read-only.
Repository navigation
This repository was archived by the owner on Dec 14, 2018. It is now read-only.
GetOrCreate / GetOrCreateAsync on IMemoryCache creates cache entry even when factory throws #211
It seems wrong that a cache entry is added with the value null when the factory method throws:
try
{
memoryCache.GetOrCreate("key", entry =>
{
throw new Exception();
return 123;
});
} catch (Exception e)
{
// memoryCache now has an entry for "key" with the value null. This seems odd.
}
The expected behaviour should be that the value is not added to the cache if the factory throws.
When will preview 1 be released?
We just got hit hard by this bug, we'll might have to use the nightly builds on production 😢 until it's being released.
Activity
Tratcher commentedon Jul 12, 2016
Agreed. There should not be a using statement on this line:
Caching/src/Microsoft.Extensions.Caching.Abstractions/MemoryCacheExtensions.cs
Line 103 in c432e58
BrennanConroy commentedon Jul 25, 2016
18f2259
gdoron commentedon Oct 1, 2016
When will preview 1 be released?
We just got hit hard by this bug, we'll might have to use the nightly builds on production 😢 until it's being released.