Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[redis-messenger] remove undefined array key warnings#45619
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
carsonbot commentedMar 2, 2022
Hey! Oh no, it looks like you have made this PR towards a branch that is not maintained anymore. :/ Cheers! Carsonbot |
PhilETaylor commentedMar 2, 2022
Rebased to 5.4 |
carsonbot commentedMar 3, 2022
Hey! I think@Steveb-p has recently worked with this code. Maybe they can help review this? Cheers! Carsonbot |
nicolas-grekas commentedMar 4, 2022
Thank you@PhilETaylor. |
Uh oh!
There was an error while loading.Please reload this page.
check that we actually have some information back from redis before assuming its an array with 2 keys to avoid undefined array key warnings as per#45270
so the code in question is this:
I think what's happening, as I often can have up to 1000 workers (yup, for real, making 1000 http requests to remote sites - see mySites.guru) I think the logic might be flawed.
Because, the following line gets the number of messages using ZCOUNT
It will then enter a loop counting down that number of messages checking them
At the same time, 999 other workers can be doing the same thing
it gets to a point where one of the workers doesnt get a message back from
ZPOPMINand thus we get undefined array keys...You can see the result of ZPOPMIN is no longer an array once empty using the interactive test on the official redis page.