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
  • #2033
Closed
Open
Issue created Apr 29, 2021 by Administrator@rootContributor

moveToDelayed contains duplicate lock GET

Created by: bruun

Description

While digging into some (probably unrelated) issue with missing locks for failed jobs that needs to be moved to "delayed", I took a look inside moveToDelayed-3.lua and noticed there are two GET's for the lock:

-- Check for job lock
if ARGV[3] ~= "0" then
  local lockKey = KEYS[3] .. ':lock'
  local lock = rcall("GET", lockKey)
  if rcall("GET", lockKey) ~= ARGV[3] then
    return -2
  end
end

The corresponding lock check in moveToFinished-7.lua does not fetch the lock twice, which is why I'm wondering if this might be unintentional?

Also, the documentation in moveToDelayed says the following:

  Output:
    0 - OK
   -1 - Missing job.
   -2 - Job is locked.

Shouldn't this be "-2 - Missing lock", like in moveToFinished-7.lua? If not, the error thrown when handling this error in scripts.finishedErrors should probably be changed: Error: Missing lock for job <jobId> delayed.

Bull version

3.22.4

Assignee
Assign to
Time tracking