Skip to content
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

queue.close() kills all processes (jobs) running in all queues #172

Closed
Gustav0ar opened this issue Apr 7, 2020 · 3 comments
Closed

queue.close() kills all processes (jobs) running in all queues #172

Gustav0ar opened this issue Apr 7, 2020 · 3 comments
Labels

Comments

@Gustav0ar
Copy link

Firstly, I'd like to congratulate you for this awesome library, it helped me a lot.
I've encountered an issue in my app when I create separate Queues (with different names) to execute a single job and when the job finishes I close the queue.
There is a bug when doing queue.close() that will kill every job running in separate processes in all queues, not just the one I'm closing.
I traced the bug to child-pool.ts on line 98, it will get all the processes running in this.retained and kill them. It should filter out to only get the processes linked to that specific queue.

The steps to reproduce are the following:

  1. Create queue A
  2. Run job on queue A
  3. Create queue B
  4. Run a job on queue B
  5. Execute queue.close() on either one while both jobs are running
  6. It will kill both processes, not just the one for the queue that you executed
@manast
Copy link
Contributor

manast commented Apr 10, 2020

but the child pool is not global so killing the retained processes should only kill the ones belonging to a given queue. Can you provide a complete test case so that I can run it myself?

@Gustav0ar
Copy link
Author

@manast Thanks for the response. I'm using Queue3, that might be the issue. Here is the example with the bug: https://github.com/Gustav0ar/bullmqQueueBug

@manast manast closed this as completed in bc65f26 Apr 10, 2020
manast pushed a commit that referenced this issue Apr 10, 2020
…-10)

### Bug Fixes

* **worker:** do not use global child pool fixes [#172](#172) ([bc65f26](bc65f26))
@manast
Copy link
Contributor

manast commented Apr 10, 2020

🎉 This issue has been resolved in version 1.8.7 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants