tporadowski / redis

Native port of Redis for Windows. Redis is an in-memory database that persists on disk. The data model is key-value, but many different kind of values are supported: Strings, Lists, Sets, Sorted Sets, Hashes, Streams, HyperLogLogs. This repository contains unofficial port of Redis to Windows.
http://redis.io
Other
8.9k stars 1.09k forks source link

BRPOPLPUSH command returns immediately #94

Open mrniko opened 3 years ago

mrniko commented 3 years ago

Describe the bug/issue BRPOPLPUSH command with 2 or 1 second returns immediately if queue is empty.

To Reproduce Redis 5.0.10 for Windows

Crash report No

INFO output No

Event Log No

Additional context Redis single

tporadowski commented 3 years ago

@mrniko could you please provide a test case? I've tried the following:

127.0.0.1:6379> BRPOPLPUSH issue94 issue94_dest 500
"value1"
(15.73s)
127.0.0.1:6379> BRPOPLPUSH issue94 issue94_dest 5
(nil)
(5.07s)
127.0.0.1:6379> BRPOPLPUSH issue94 issue94_dest 1
(nil)
(1.04s)
127.0.0.1:6379> BRPOPLPUSH issue94 issue94_dest 2
(nil)
(2.02s)
127.0.0.1:6379> BRPOPLPUSH issue94 issue94_dest 2
"nil"
127.0.0.1:6379> BRPOPLPUSH issue94 issue94_dest 2
(nil)
(2.02s)
127.0.0.1:6379> BRPOPLPUSH issue94 issue94_dest 4
(nil)
(4.01s)

And basically it always returns after requested timeout (or of course when there is an element pushed to the list) - as indicated above.