OptimalBits / bull

Premium Queue package for handling distributed jobs and messages in NodeJS.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

priority queue

kakopappa opened this issue · comments

Hi Guys,

Description

When I ran redis-cli --bigkeys

Scanning the entire keyspace to find biggest keys as well as
average sizes per key type. You can use -i 0.1 to sleep 0.1 sec
per 100 SCAN commands (not usually needed).

..
[08.98%] Biggest zset found so far 'bull:xxxxxxx:priority' with 193085 members

...

I noticed one of the queues 'bull:xxxxxxx:priority' has 193085 members.. which seems unusual.

just wondering whether it's safe to clear this?

This is the code i have used to add the job

  const queue = new Queue('xxxxxxx);
  const queueOpts = {
    priority: 3, attempts: 1, removeOnComplete: 10, removeOnFail: 10,
  };
  const job = await queue.add(json, queueOpts);
  queue.close(true);

Bull version

^4.5.1

If the priority logic is working properly you should not have more elements in that zset than in the waiting list. So it seems to me that something broke and now the priority order is not guaranteed anymore. In this case, if you can, delete the whole queue and start over.

Thanks for the prompt response