bullmq icon indicating copy to clipboard operation
bullmq copied to clipboard

[Bug]: worker is not closing on Bun

Open dimonnwc3 opened this issue 2 years ago • 2 comments

Version

v4.11.0

Platform

NodeJS

What happened?

When using Bun 1.0.0, calling close on worker hangs indefinitely

How to reproduce.

import { Queue, Worker } from "bullmq"

export const bullMQBaseOptions = {
  connection: {
    host: "localhost",
    port: 6379,
  },
}

export const usersQueue = new Queue("users", bullMQBaseOptions)

export const usersWorker = new Worker(
  "users",
  async (job) => {},
  bullMQBaseOptions,
)

usersQueue.add("users-cleanup", null, {
  repeat: {
    every: 10000,
  },
})

setTimeout(async () => {
  console.log("should close")
  await Promise.all([usersQueue.close(), usersWorker.close()])
  console.log("closed")
}, 2000)

Relevant log output

❯ bun ./bin/worker.js
[0.02ms] ".env"
should close


### Code of Conduct

- [X] I agree to follow this project's Code of Conduct

dimonnwc3 avatar Sep 17 '23 14:09 dimonnwc3

Thanks for reporting this. I removed the Bug label as Bun is not officially supported yet https://github.com/taskforcesh/bullmq/issues/2177

manast avatar Sep 22 '23 09:09 manast

With the latest version of Bun (1.1.9) this seems to have been fixed

nullndr avatar May 23 '24 06:05 nullndr