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

RedisDependencyManager doesn't handle redis not being available #1

Open
glav opened this issue Aug 21, 2017 · 0 comments
Open

RedisDependencyManager doesn't handle redis not being available #1

glav opened this issue Aug 21, 2017 · 0 comments
Labels

Comments

@glav
Copy link
Owner

glav commented Aug 21, 2017

Using version 4.1.1 ,if the redis server isn't running or can't be connected to, the call to _redisDatabase.KeyExists() in RegisterParentDependencyDefinition() throws an exception.
My config is as follows:
It looks like the method: Get(string cacheKey, DateTime absoluteExpiryDate, Func getData, string parentKey = null, CacheDependencyAction actionForDependency = CacheDependencyAction.ClearDependentItems) handles the cache not being available when checking for the item, it's the code that tries to update the dependencies that doesn't.

After playing with this some more, I think there are two situations to consider:

  1. redis is not available when the application starts (or is recycled)
  2. redis is temporarily unavailable while the application is running

Event 2 is more likely to occur and I don't want it to make my app throw an exception. When reading, it should treat it as if it's not cached. An error when writing is trickier - perhaps only this web app can't connect, and others are fine? What if this is a dependency clear - other apps may still be able to get old data from redis.

Issue raised by @pdonovan on Bitbucket 2016-04-19 and migrated to Github

@glav glav added the bug label Aug 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant