Skip to content

Commit 031eef6

Browse files
committed
Redis Client: fix BLPOP and BRPOP
The timeout value was added to the command twice, which is incorrect. The correct position is _after_ the keys; inserting it before the keys makes the timeout value a key itself (one that likely does not exist). That doesn't need to be especially problematic with a standalone client, because Redis will just ignore keys that do not exist, but it becomes especially problematic with a cluster client, because the command may suddenly target multiple nodes. This ends up with an error immediately, on the client side.
1 parent 31fbfdf commit 031eef6

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

extensions/redis-client/runtime/src/main/java/io/quarkus/redis/runtime/datasource/AbstractListCommands.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ Uni<Response> _blpop(Duration timeout, K... keys) {
127127
validate(timeout, "timeout");
128128

129129
RedisCommand cmd = RedisCommand.of(Command.BLPOP);
130-
cmd.put(timeout.toSeconds());
131130
cmd.putAll(marshaller.encode(keys));
132131
cmd.put(timeout.toSeconds());
133132

@@ -140,7 +139,6 @@ Uni<Response> _brpop(Duration timeout, K... keys) {
140139
validate(timeout, "timeout");
141140

142141
RedisCommand cmd = RedisCommand.of(Command.BRPOP);
143-
cmd.put(timeout.toSeconds());
144142
cmd.putAll(marshaller.encode(keys));
145143
cmd.put(timeout.toSeconds());
146144

0 commit comments

Comments
 (0)