Comments (9)
Hey - thanks for bringing this up! I was planning on fixing this at some point, but you convinced me to fix it right now! 😄
from nhibernate.caches.redis.
Cool, thank you for such a fast fix! :-)
from nhibernate.caches.redis.
I did some tests and this exception is indeed swallowed now so Cache can operate without issues even when connection is broken but even when Redis is back it does not seem to recover and keeps throwing this exception. Is it some issue with ServiceStack.Redis maybe ?
from nhibernate.caches.redis.
Hmm - I have an integration test that should cover this (I just updated it to be more robust) and it's still passing for me. Could you try:
- Run the sample.
- Add a couple of posts.
- Kill Redis.
- Refresh
What happens here when running the sample? It resumes fine for me (retrieving the posts from the cache after it's been restored). Is there a different exception thrown? If so, could you paste it here?
Thanks!
from nhibernate.caches.redis.
Yeah that's a weird one.
My scenario is like this:
- I'm using PooledRedisClientManager
- When Redis server goes down and back again (simply restarted or is switched to slave backup server) cache will stop working. It is caused because RedisNativeClient is throwing exceptions that are swallowed by your Cache Provider (good thing). Problem is that these connections will never recover and this exception will happen constantly.
Exception is System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
at System.Net.Sockets.Socket.Send(IList1 buffers) at ServiceStack.Redis.RedisNativeClient.FlushSendBuffer() at ServiceStack.Redis.RedisTransaction.Exec() at ServiceStack.Redis.RedisTransaction.Commit() at NHibernate.Caches.Redis.RedisCache.ExecuteEnsureGeneration(Action
1 action) in c:\DEV\NHibernate.Caches.Redis\src\NHibernate.Caches.Redis\RedisCache.cs:line 315
at NHibernate.Caches.Redis.RedisCache.Get(Object key) in c:\DEV\NHibernate.Caches.Redis\src\NHibernate.Caches.Redis\RedisCache.cs:line 156
I'm using yours RedisSessionProvider that seems to behave in a way that only first connection after Redis restart is throwing an exception and subsequent are ok.
from nhibernate.caches.redis.
I've found something out just now.
As I'm using both Cache and Session providers I was creating two PooledRedisClientManagers (as Cache and Sessions can be stored on different servers - they are not currently though). Just now I've tried to reuse the same PooledRedisClientManager and there seem to be no problem ?!?
I guess it's all down to ServiceStack.Redis not your provider really...
I will ask ServiceStack ppl than, thanks for your help!
from nhibernate.caches.redis.
Yeah - I'm wondering if the two client managers are sharing state...?
from nhibernate.caches.redis.
Check out #8 where I've switched to StackExchange.Redis... hopefully all Redis-related problems can go away.
from nhibernate.caches.redis.
@kowalgta I'm going to close this due to lack of activity. Also, I just pushed the 2.0 release which now uses StackExchange.Redis as the Redis provider. Please give it a shot and let me know if you have any problems.
from nhibernate.caches.redis.
Related Issues (20)
- Should Lock()/Unlock() sync the generation? HOT 1
- Needs reference to ServiceStack.Interfaces 3.9.9.0 HOT 13
- Why Generation and Keyset? HOT 3
- Failing to acquire a lock should return the existing lock value for debugging
- System.Object' to type 'System.Byte[] HOT 8
- Benefits to using NhCacheJsonSerialiser HOT 3
- LockTimeout value HOT 1
- SetOfActiveKeysKey is not cleaned up and hogs cpu/memory over time HOT 11
- Lua script attempted to access a non local key in a cluster node HOT 1
- Timeout performing SET HOT 1
- NHibernate version HOT 1
- NHibernate.Caches.Redis.2.0.0 dependency on nhibernate 3.3.1.4000 HOT 1
- Multiple session factories with different options HOT 3
- NHibernate.Caches.Redis 2.0.0 always looking for NHibernate 3.3.1.4000
- Getting a lot of timeouts when acquiring locks HOT 7
- Nhibernate 5 chacged ICache interface adding async methods Nhibernate.Caches.Redis fails with it HOT 1
- Table Based Cache
- The connection multiplexer can only be configured once exception HOT 2
- Not implement exception with method 'GetAsync' HOT 3
- Caching time HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nhibernate.caches.redis.