I have a very simple implementation on python using redis-py to interface with Redis. As part of the development, I am shutting redis down to simulate a timeout exception. Problem is that I am setting the timeout to a few seconds, but the connection just sits there without timing out.
from redis import StrictRedis
print('Connecting')
redis_instance = StrictRedis(host=settings.REDIS_HOST,
port=settings.REDIS_PORT,
db=settings.REDIS_DB,
socket_connect_timeout=5,
socket_timeout=5,
)
print('Setting key')
redis_instance.set('X','Y')
print('Key SET')
I can see it goes up to Setting key
message, but doesnt go beyond that or throw a timeout.
Any idea what I am doing wrong?