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

moveToDelayed contains duplicate lock GET #2033

Closed
bruun opened this issue Apr 29, 2021 · 2 comments
Closed

moveToDelayed contains duplicate lock GET #2033

bruun opened this issue Apr 29, 2021 · 2 comments

Comments

@bruun
Copy link

bruun commented Apr 29, 2021

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

@manast manast added the bug label Apr 29, 2021
@stale
Copy link

stale bot commented Jul 12, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jul 12, 2021
@manast manast closed this as completed in 2800cf8 Jul 15, 2021
github-actions bot pushed a commit that referenced this issue Jul 15, 2021
## [3.23.3](v3.23.2...v3.23.3) (2021-07-15)

### Bug Fixes

* **delayed:** do not get lock twice fixes [#2033](#2033) ([2800cf8](2800cf8))
@manast
Copy link
Member

manast commented Jul 15, 2021

🎉 This issue has been resolved in version 3.23.3 🎉

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
Projects
None yet
Development

No branches or pull requests

2 participants