What happens if all redis nodes aren't available #452
-
Hi, I'm currently using pottery for redlock purposes with 1 redis master. My question is, what's the expected behaviour should the node fail or be unavailable? redis = Redis.from_url("redis://wrong_url")
lock = Redlock(key="name", masters={redis})
with lock:
print("Never prints")
print("Never prints") I think the appropriate behaviour is to either raise an exception or skip everything covered by the lock? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Didn't mean to answer my own question but I just noticed the optional parameter |
Beta Was this translation helpful? Give feedback.
-
if you're using Example: import redis
redis.ConnectionPool.from_url('redis://localhost:6379/0', socket_connect_timeout=2, socket_timeout=3)
redis.StrictRedis(connection_pool=self._pool)
Redlock(key="name", masters={redis}, raise_on_redis_errors=True) |
Beta Was this translation helpful? Give feedback.
Didn't mean to answer my own question but I just noticed the optional parameter
raise_on_redis_errors
.Btw I couldn't figure out what
context_manager_timeout
does.