-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BZPOPMIN will hang for ever when a short disconnection happens and the port is different from 6379 #1888
Comments
Hi @manast, I can not reproduce this with ioredis
I do get connection errors and reconnecting output as expected when disconnecting I always get the ![]() |
This one was pretty weird but quite serious. If you issue a BZPOPMIN command, and there is a small disconnection while the command is blocking, then it will stay blocking forever, effectively hanging the app that uses the command.
Now, one of the insane things about this issue is that to reproduce it you must use a port different than the standard 6379, and also use docker network disconnect, it is not enough to just stop the docker container running Redis:
Try this code:
bug.mjs:
docker-compose.yml:
Start the docker container with:
Run the test with:
Results in:
Now in a different terminal, and depending on where you run the docker (I had my docker compose on directory ioredis-econnreset:
The Redis network was disconnected and connected again after 3 seconds. Open a Redis cli:
The terminal with the node app will stay the same, with no error or nothing. If you restart the app and without disconnecting and reconnecting you try again to ZADD to the key you will get instead:
Let me know if you need more information.
The text was updated successfully, but these errors were encountered: