In the examples when the NewRedisMemoLock is initialised a 5-15 second lockTimeout is provided.
This is what's passed to SetNX when acquiring the lock.
However, when I open a terminal into my redis instance and do KEYS * to list the locks and then TTL ${resourceTag}/lock:${resID} it returns this:
127.0.0.1:6379> TTL report/lock:123
(integer) 19999999845
When I run it a few seconds later:
127.0.0.1:6379> TTL report/lock:123
(integer) 19999999835
Which seems to suggest the actual TTL applied onto the lock is 2 billion seconds.
This presents an issue running the examples, because nowhere in the RedisMemoLock actually explicitly frees the lock, once the examples have been called once we can never re-aquire the lock.
Do you have any idea why redis is not respecting the lockTimeout provided by us?
Redis Version
Running redis via docker with default settings.
Redis version=7.0.10, bits=64, commit=00000000, modified=0, pid=1, just started
2023-07-23 01:21:40 1:C 23 Jul 2023 00:21:40.091 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
In the examples when the
NewRedisMemoLockis initialised a 5-15 second lockTimeout is provided.This is what's passed to
SetNXwhen acquiring the lock.However, when I open a terminal into my redis instance and do
KEYS *to list the locks and thenTTL ${resourceTag}/lock:${resID}it returns this:When I run it a few seconds later:
Which seems to suggest the actual TTL applied onto the lock is 2 billion seconds.
This presents an issue running the examples, because nowhere in the
RedisMemoLockactually explicitly frees the lock, once the examples have been called once we can never re-aquire the lock.Do you have any idea why redis is not respecting the lockTimeout provided by us?
Redis Version
Running redis via docker with default settings.