jcoleman / tomcat-redis-session-manager

Redis-backed non-sticky session store for Apache Tomcat
MIT License
1.8k stars 1.12k forks source link

JedisConnectionException if Redis is down #99

Open carmides opened 7 years ago

carmides commented 7 years ago

I get an exception if Redis is down: redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool at redis.clients.util.Pool.getResource(Pool.java:42) at redis.clients.jedis.JedisPool.getResource(JedisPool.java:84) Caused by: redis.clients.jedis.exceptions.JedisConnectionException: java.net.ConnectException: Caused by: java.net.ConnectException:

As a result, Tomcat cannot run any application. I've also tested Memcached as session manager and Tomcat keeps up and running even if Memcached is down. I'm not sure if this is the expected behaviour with Redis. How can I configure it to avoid this exception?

Thanks very much

jcoleman commented 7 years ago

@carmides What would you expect to happen? If Redis is down then you wouldn't be able to service requests anyway, right? So I'm not sure what behavior you're looking for.

carmides commented 7 years ago

@jcoleman If I configure Memcached in Tomcat and Memcached is not available, Tomcat keeps running. And when Memcached is up again, it resynchronizes sessions. While Memcached is down, I get exceptions (Socket exceptions like "net.spy.memcached.MemcachedConnection: Reconnecting due to failure to connect ") but applications are able to serve requests properly.

Although Redis performs as a rock solid, I'd like to avoid possible points of failure.