You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Building a tool similar to Sidekiq but that works with multiple processes, dedicated for web crawling.
We use the queue where we need:
unique values
ordered by the priority
Sorted sets sound like a great option and they have BZPOPMIN/MAX. While the work is picked up from Redis we then need to push it back to another sorted set that holds "work in progress".
Depending on a result move it either to throttled, suspended, failed, etc sets, keeping the original score.
The fact we need to get data from Redis and push it back creates a point of failure in the case of an unexpected error, segmentation-fault, or other disruptions the work fetched from Redis will be lost.
Instead, it would be great to have atomic operations such as BLMOVE for lists. This way we can move jobs back and forth without the risk of losing them and properly recover after a failure.
Reacted by Radim Řehůřek, Gabriel Zimmermann, CJ Enright, Alexander, Serge White and Alexander S.
Hello @heaven - I like what you're saying, which sounds to me like: BZMOVE <source> <destination> MIN|MAX [BYSCORE | BYLEX] <timeout> (and a ZMOVE w/o the timeout).
I'm unsure about SMOVE's necessity, especially given SPOP's semi-randomness, so more details would probably help me to understand.
Hello @itamarhaber, regarding sets we also have a use case where we could use them instead of lists to prevent duplicates in the queue and SPOP doesn't work due to race conditions when multiple workers pick up the same job. But our primary missing feature is BZMOVE which would make our application quite bulletproof.
+1: we have an almost identical need for atomic ZMOVE / BZMOVE. Also to prevent race conditions when shuffling elements between work-in-progress ordered sets.
Activity
heaven commentedon Dec 23, 2021
Forgot to mention that having non-blocking versions of these would also be fantastic.
itamarhaber commentedon Dec 23, 2021
Hello @heaven - I like what you're saying, which sounds to me like:
BZMOVE <source> <destination> MIN|MAX [BYSCORE | BYLEX] <timeout>(and aZMOVEw/o the timeout).I'm unsure about
SMOVE's necessity, especially givenSPOP's semi-randomness, so more details would probably help me to understand.heaven commentedon Dec 23, 2021
Hello @itamarhaber, regarding sets we also have a use case where we could use them instead of lists to prevent duplicates in the queue and
SPOPdoesn't work due to race conditions when multiple workers pick up the same job. But our primary missing feature isBZMOVEwhich would make our application quite bulletproof.VeaaC commentedon May 11, 2022
I am definitely looking forward to BZMOVE, as it enables us to implement reliable per-customer-FIFO priority queues much more efficiently.
piskvorky commentedon Dec 1, 2022
+1: we have an almost identical need for atomic ZMOVE / BZMOVE. Also to prevent race conditions when shuffling elements between work-in-progress ordered sets.
gabzim commentedon Dec 31, 2022
Is this still in scope?
guybe7 commentedon Jan 16, 2023
[B]ZMOVE added in #10430
Add atomic sorted-set moves with batching and destination conditions (#…
sundb commentedon Nov 11, 2026
Closed via #16135