go-redis
go-redis copied to clipboard
Calling Brpop on Windows with 0 as the second parameter will cause duplicate requests
I'm practicing writing queues with redis, but I'm running into the problem mentioned in the title.
Expected Behavior
I used the redis-cli monitor command to see the redis commands that my program called, this is the normal result I get under macOS, and the same when I pass a non-zero value to the second parameter of Brpop result.
And this is normal output of my program.

Current Behavior
When I run the program on Windows and the parameter passed to Brpop is 0, the output of redis-cli monitor becomes like this.
The output of my program becomes like this.

Possible Solution
This is the code I see when stepping through it, it seems to re-execute the brpop command for some reason, but in fact the result of the last execution was successful. Maybe it's because the judgment of retry is too brute force?

Steps to Reproduce
This is where I wrote the code: https://github.com/LemonNekoGH/simple-queue-practice
Context (Environment)
Go version: 1.18.3 OS: Windows 10 19044.1766 Redis: Running in Docker on the computer above, version 7.0.2