-
Notifications
You must be signed in to change notification settings - Fork 359
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: worker.close
hangs forever when queue is empty
#2237
Comments
This issue comes from this other issue in IORedis: redis/ioredis#1830 |
This is actually working perfectly using NodeJS instead of Bun. For some reason, I started reproducing the issue with Bun and forgot about it. I am trying with version 18.10.0 on MacOS and it does not hang at all. |
workaround async function handlerShutdown() {
console.info('worker closing')
- await worker.close()
+ await Promise.all([worker.close(), sleep(3 * 1000)])
+ await worker.close(true)
console.info('worker closed')
console.info('queue closing')
queue.close()
console.info('queue closed')
console.info('connection disconnecting')
connection.disconnect()
console.info('connection disconnected')
} |
With the latest version of Bun (1.1.9) this seems to have been fixed |
Version
bullmq: v4.12.4
redis: v7.2
bun: v1.0.6
Platform
NodeJS
What happened?
When the queue is empty (no jobs added), calling
worker.close
will hang and prevent a graceful shutdown.How to reproduce.
Relevant log output
Code of Conduct
The text was updated successfully, but these errors were encountered: