Closed
Description
In redis-cli I try this:
127.0.0.1:6379> set foo bar ex 0
(error) ERR invalid expire time in set
I would expect the same with the API, but
$redis->set("foo", "bar", ["ex" => 0]);
returns true plus I see that foo exists without a ttl:
127.0.0.1:6379> ttl foo
(integer) -1
Why is this a serious issue? The TTL is used in the propagated RedLock algorithm and guarantees liveness. Now assume a PHP developer did by some mistake put something like "2280s" as ttl parameter (I saw that really). As nothing blows up he will assume everything works as expected, but the database will slowly degrade with unreleased locks.
So I would expect that above mentioned API call would throw an exception, return false or what ever, but in no case silently set the key without an expiration.
Metadata
Metadata
Assignees
Labels
No labels