Giter VIP home page Giter VIP logo

Comments (9)

TheCloudlessSky avatar TheCloudlessSky commented on August 18, 2024

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.

kowalgta avatar kowalgta commented on August 18, 2024

Cool, thank you for such a fast fix! :-)

from nhibernate.caches.redis.

kowalgta avatar kowalgta commented on August 18, 2024

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.

TheCloudlessSky avatar TheCloudlessSky commented on August 18, 2024

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:

  1. Run the sample.
  2. Add a couple of posts.
  3. Kill Redis.
  4. 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.

kowalgta avatar kowalgta commented on August 18, 2024

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(Action1 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.

kowalgta avatar kowalgta commented on August 18, 2024

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.

TheCloudlessSky avatar TheCloudlessSky commented on August 18, 2024

Yeah - I'm wondering if the two client managers are sharing state...?

from nhibernate.caches.redis.

TheCloudlessSky avatar TheCloudlessSky commented on August 18, 2024

Check out #8 where I've switched to StackExchange.Redis... hopefully all Redis-related problems can go away.

from nhibernate.caches.redis.

TheCloudlessSky avatar TheCloudlessSky commented on August 18, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.