Changed wait_for_group logic#1
Conversation
|
Hi @baratrion , thanks, for the bug report. I have ran your test code and confirmed there is a problem but I think the source is a bit different from what you describe. I have rechecked the logic and it seems correct for how The problem I see is that The solution I see is to change the condition to |
|
Hi @fergalwalsh, yes, you've elaborated the problem nicely. However, without trying out your suggestion first, wouldn't Then, it'd cause it to block at least until there's an item, so |
|
@baratrion yup right you are. That must be why I used Unfortunately the timeout must be an So at the moment I'm not really sure what the best solution is. Any ideas? |
|
Probably the best solution would be Redis having floating timeouts, but I'd suggest taking a look at my changes also. Do you have any objections using an interval (default 1 secs) for popping results and calculating |
Previously, the logic for waiting for tasks within a group had a small bug: it was calculating remaining time before
brpoping a task, effectively only getting result of a single task that is close totimeout.It's better to go over it with an example:
Results in:
After this change the result is as follows: