Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bull
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 175
    • Issues 175
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 9
    • Merge requests 9
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OptimalBits
  • bull
  • Issues
  • #2372
Closed
Open
Issue created Jun 09, 2022 by Administrator@rootContributor

why is queue.close() too slow.. and why is it not empty?

Created by: snawaz

queue.close() takes almost 0.5 secs to complete and debugging further, I found that line #1269 is being slow (inside whenCurrentJobsFinished which is being called by .close()).

https://github.com/OptimalBits/bull/blob/5649689531feef18956175e0db638592664279d3/lib/queue.js#L1265-L1270

I splitted the line to measure the time elapsed as follows:

const t1 = new Date().getTime();
await Promise.all(this.processing);  
console.log("elapsed: ", (new Date().getTime() - t1)/1000);  // this reports almost 0.5 seconds!
return forcedReconnection;

Interestingly, my service does not add any job to the queue, yet this.processing.length is 4. Why is it not 0?

I"m using v3.22.0 but this code has not changed since then. Not sure if the other part of codebase makes this efficient in the recent version. I'm planning to use bullmq (nestjs/bullmq) instead. Just want to know if this slowness is known and acceptable?

Assignee
Assign to
Time tracking