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
  • #994
Closed
Open
Issue created Jul 11, 2018 by Administrator@rootContributor

Question: queue.getJobs() race condition

Created by: fyodorvi

From getJobs() implementation I can see that unlike getJobCounts() you don't use transaction to get the jobs, which is potentially very dangerous since you might have jobs transitioning state while you are getting every state separately:

queue.getJobs(['active', 'waiting']);

Job 1 is in waiting state. getJobs gets 'active' jobs => [] (empty array) Job 1 transitions to active state getJobs gets 'waiting' jobs => [] (empty array)

Could you please tell me if I'm wrong, or clarify why it's done without a transaction or tell me it's a bug.

Thanks.

Assignee
Assign to
Time tracking