-
Notifications
You must be signed in to change notification settings - Fork 120
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
Unable to activate FAIL-SAFE (no entries in memory or distributed) on multiple requests #38
Comments
Hi @arnoldsi-vii , thanks fro trying out FusionCache!
Thanks for pointing this out, I should probably change that logging. So what I'm saying is that there's nothing to worry about. The "problem" is that I'm using the same log level used for fail-safe activation (by default is warning, see here) even for this message (see here), whereas I should've used something different, like trace for example. I'll change this in the next release, thanks!
Looking at your code and I'm wondering if you have a reason to use 2 calls (a "get" + a "set") instead of a single
Which one you used?
I'd like to understand more about this: it may be the fact you are not using the Try with this code: public async Task<Data> GetDataAsync(string identifier, IdentifyBy identifyBy)
{
var cacheKey = $"Info:{identifier}:{identifyBy}";
var data = await _cache.GetOrSetAsync<Data>(
cacheKey,
_ => {
_logger.LogInformation($"Data Information was not in the cache. identifier: {identifier} by { identifyBy }");
return new Data { Id = 1 };
},
TimeSpan.FromMinutes(10)
);
return data;
} Or, if you want an even shorter version without the logging line: public async Task<Data> GetDataAsync(string identifier, IdentifyBy identifyBy)
{
return await _cache.GetOrSetAsync(
$"Info:{identifier}:{identifyBy}",
new Data { Id = 1 },
TimeSpan.FromMinutes(10)
);
} Please try one of these versions and let me know. |
Hi @jodydonetti, |
Ok, so to recap: because of legacy issues you cannot switch from 2 calls (a get + a set) to 1 call ( Having said this, is there anything else I can help you with? PS: of course I will still update the logging message about being |
@jodydonetti I will keep testing the library. Even probably will put on one of our services that run in production. keep up with great work! |
Meanwhile I published an alpha2 release, containing the change in the log level we discussed here. |
Hi @arnoldsi-vii can I close this issue or is there anything else I can do? Btw I'm still intrigued to understand why you can use 2 calls (Get+Set ) but not 1 single call (GetOrSet) in your |
@jodydonetti long time ago we had deadlock situation when we used GetOrSet with one item required by other. It was design flow, but back then we best solution (time wise) was separate them. Now changing everything back to GetOrSet will create a lot of regression tests for us. New methods are using GetOrSet :) |
Got it, makes sense! And thanks for the explanation 👍 |
@jodydonetti I kept testing the library on 2 projects. One is updating the data, the other is API for read data. Do you have an idea what might be an issue? This is the configuration:
I would like to know if anyone in the community talked same issues |
@arnoldsi-vii I think you will need the backplane (it is alpha release right at this moment). #11 you can probably reduce the impact somewhat by decreasing the cache timeout on the read API so that it picks up any changed values much sooner. |
@wileyveteran from my understanding the current version also supposed to sync cache |
Hi @arnoldsi-vii what version are you using? Anyway @wileyveteran is correct in saying that to have data in sync between 2 nodes (or in general 2 app instances, even in the same node) you need the backplane #11, which has been just released in alpha (see here). To be clear, the backplane is the actual mechanism used to have different memory cache instances talk to each others to sync cache entries, so that when one is removed on one hand, it will be also removed on all the others. Let me know if there's something I can help you with. |
Hi all, just wanted to update you on the next version: I released right now the BETA2 for the next big release, which includes among other small things a big fix for the DI setup part. This will probably be the last release before the official one. Closing this issue since as of now I don't see anything to do here. Happy to re-open in case I'm missing something. Thanks all. |
Hi,
We are testing your cache implementation, well done for a great work. During Load testing on One API call we started to get the
Unable to activate FAIL-SAFE (no entries in memory or distributed)
warning.It managed to set data on high volume of requests, but after many many misses
Here is my code:
The text was updated successfully, but these errors were encountered: