bullmq: Jobs stuck in delayed state indefinitely

I have a queue with mostly delayed jobs which get stuck in delayed state indefinitely. Restarting the worker solves the issue temporarily but it re-occurs on a regular basis.

I was trying to replicate the issue but the cause is unclear to me and I’m not sure how to proceed with investing what is happening here.

From what I understand everything stalls when worker is waiting for a job and calls BRPOPLPUSH:

const jobId = await client.brpoplpush(
  this.keys.wait,
  this.keys.active,
  blockTimeout,
);

The client list shows there’s a connection for this command:

id=387154 addr=[<redacted>]:44672 laddr=[<redacted>]:25060 fd=15 name= age=19775 idle=19775 flags=b db=0 sub=0 psub=0 ssub=0 multi=-1 qbuf=85 qbuf-free=0 argv-mem=105 multi-mem=0 rbs=1024 rbp=0 obl=0 oll=0 omem=0 tot-mem=2025 events=r cmd=brpoplpush user=default redir=-1 resp=2

There are no errors being emitted by the worker too. It looks like BRPOPLPUSH is not timing out properly and unless a new job in active / wait state is added or worker is restarted it never ends.

Is there anything I can do to prevent this from happening or to find the root cause of this issue? I’m happy to work on the PR once it clear what is causing this behavior.


Redis version: 7.0.5 (DigitalOcean Managed Redis) Bull MQ version: 3.5.11

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 20 (10 by maintainers)

Most upvoted comments

Closing this now since the issue has been resolved in ioredis in version 5.3.1