Replies: 1 comment 1 reply
-
rate-limit has been rewritten and improved in BullMQ so most likely this issue is not there, if you can, try to upgrade. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've ran into a situation in which newer jobs added to the queue (no priority set) are being processed before older jobs in the queue (e.g. older job timestamp), when a rate limiter is in place.
I've got it down to where I can sometimes reproduce this with some test queue code I wrote.
The basic premise of the test is: queue a large number of messages, with 30 seconds of sleep time between each batch. Each batch had some overlap in job IDs as the previous batch.
The queue is configured with this limiter:
The messages are queued (by looping and calling
.add
to the queue, as we were not sure if the bulk add preserved order). The batches are as follows:(Again, between the above batches, the producer code slept for 30 secs.)
The processor job code just inserts a record to a db table, which includes:
When the 3 batches were done, I queried the DB, in job completion order, for a job with batch number N being processed before a job with batch number N-1.
I have been unable to narrow this down to a simpler test case, unfortunately.
Beta Was this translation helpful? Give feedback.
All reactions