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
  • #958
Closed
Open
Issue created May 24, 2018 by Administrator@rootContributor

Huge slowdown in resolution of job.finished() promise if add called with some delay after process

Created by: pcernek-spare

Description

Create a queue -> add a (trivial) processor function -> wait 100 ms -> add a job -> wait for job.finished(): takes ~5 seconds Do the same thing, but remove the "wait 100 ms" step: takes ~ 200 ms

Minimal, Working Test code to reproduce the issue.

index.js

const Queue = require('bull');
const Bluebird = require('bluebird')

const queue = new Queue('myTestQueue')
const delayMs = 100

queue.process((job) => {
  return job.data + 1
})
Bluebird.delay(delayMs).then(() => {
  queue.add(42).then((job) => {
    job.finished().then(process.exit)
  })
})

Run time node index.js: takes ~ 5 s Set delayMs to 0 to remove the delay, run the same thing again: takes ~200 ms

Bull version

3.4.2

Additional information

Inserting some print statements suggests that the job gets processed very fast -- the bottleneck seems to be in the job.finished() promise resolving.

Assignee
Assign to
Time tracking