sending "expireat" command with only the key (with empty string) as part of a multi command does not return an error
A short description of the bug.
Using a multi and with at least 2 commands the redis accept sending expireat command as part of the multi with the 2nd argument as empty string
Steps to reproduce the behavior and/or a minimal code sample.
"multi" "hincrby" "foo" "bar" "123" "expireat" "foo" "" "exec
A description of what you expected to happen.
the first command should return the aggregated value the second command should return not an integer
Any additional information that is relevant to the problem.
Comment From: oranagra
@OronMA i'm not sure i understand your problem.
it's not clear which interface you're using to pass these commands to redis, and if "" is an empty string, or maybe redis get's a missing argument or an actual ".
also, please state which version of redis you're using.
anyway, there are two behaviors: 1 when redis can predict the command is gonna fail during queuing (like arity errors)
127.0.0.1:6379> multi
OK
127.0.0.1:6379> incr a
QUEUED
127.0.0.1:6379> expireat a
(error) ERR wrong number of arguments for 'expireat' command
127.0.0.1:6379> exec
(error) EXECABORT Transaction discarded because of previous errors.
2 when redis can't predict ahead of time, and ends up executing the command:
127.0.0.1:6379> multi
OK
127.0.0.1:6379> incr a
QUEUED
127.0.0.1:6379> expireat a a
QUEUED
127.0.0.1:6379> exec
1) (integer) 1
2) (error) ERR value is not an integer or out of range
I consider both of them valid, and would note that invalid arguments are a bug in the software that should be fixed during development, and the transaction atomicity issues (failing one command and executing another), are something that could be avoided by using WATCH (e.g. to avoid missing keys or ones with wrong type).
Comment From: OronMA
have you tried it without the CLI? I am getting this from the ioredis and node redis clients.. (its being passed to the server.. I am reading the resp) and inside the server i see it in the monitor.
using redis cluster 6.2.0
Comment From: oranagra
tested this on 6.2
$ telnet localhost 6379
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
multi
+OK
incr x
+QUEUED
*3
$8
expireat
$1
x
$0
+QUEUED
exec
*2
:1
-ERR value is not an integer or out of range
Comment From: oranagra
ok, so an array with two replies saying "1" (that's sounds right?), but note that that's different than your opening post (about empty string argument). i assume from the fact you closed the ticket that you concluded that there's some problem with the client libraries? (in which case please report in their repos)
Comment From: OronMA
yes.. its a problem with the ioredis repo.. once again. in the monitor i can see that it reached the redis server, and the client just ignored the error.