Fix active worker detection by using correct keys#756
Merged
mhenrixon merged 1 commit intomhenrixon:mainfrom Feb 14, 2023
marketertechnologies:fix/active_worker_detection_because_of_wrong_worker_key
Merged
Fix active worker detection by using correct keys#756mhenrixon merged 1 commit intomhenrixon:mainfrom marketertechnologies:fix/active_worker_detection_because_of_wrong_worker_key
mhenrixon merged 1 commit intomhenrixon:mainfrom
marketertechnologies:fix/active_worker_detection_because_of_wrong_worker_key
Conversation
Rename keys from :workers to :work since that's correct name set in Redis
Owner
|
Quick question: which Sidekiq and SidekiqUniqueJobs versions are you currently using? I want to make sure this gets backported if it concerns v7. |
Contributor
Author
sidekiq-unique-jobs (8.0.0) |
mhenrixon
approved these changes
Feb 14, 2023
Owner
|
Releaased as 8.0.1 and should be available in a few minutes. I know rubygems are cached pretty hard so sometimes takes a minute. |
Contributor
|
We are running |
dsander
pushed a commit
to projectivetech/sidekiq-unique-jobs
that referenced
this pull request
Apr 12, 2023
Rename keys from :workers to :work since that's correct name set in Redis
Closed
mhenrixon
pushed a commit
that referenced
this pull request
Jul 14, 2023
Rename keys from :workers to :work since that's correct name set in Redis
mhenrixon
added a commit
that referenced
this pull request
Jul 14, 2023
* Fix active worker detection by using correct keys (#756) Rename keys from :workers to :work since that's correct name set in Redis * chore(lint): fix linter issues * fix(unlock): ensure callback and unlock (#771) * chore(deps): update gems (solargraph is awesome) * fix(unlock): ensure unlock and callback runs * chore(lint): lint'em real good # Conflicts: # .github/workflows/rspec.yml # myapp/.tool-versions * fix: backport the fix for the return value of #deep_transform_keys (#750) Backport fix the return value of #deep_transform_keys * Hide lock info debug suggestion on lock page if it's already enabled. (#763) only show lock info suggestion if value is not already on * chore(v7): backport fixes from v8 * chore(ci): backport ci changes from v8 --------- Co-authored-by: Dominik Szromik <dodox360@gmail.com> Co-authored-by: Egor Romanov <unsaidxpl@gmail.com> Co-authored-by: Jeremiah <jeremiahchurch@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello,
We are using this gem for some of our products at marketer.tech.
The problem:
Recently we've spotted an issue with one our workers. The lock was not working and the same cron job was processed multiple times. After some investigation, we noticed that the reaper removes active locks which is incorrect behavior.
Root cause of the issue
It turns out that the
active?method does not find any active workers because of the naming issue. Sidekiq sets the keys with "#{key}:work" instead of "#{key}:workers". The same happens to Lua reaper.Solution:

Rename keys from
:workersto:worksince that's the correct name set in Redis:QA:
We tested those changes with our app and both reapers (Ruby & Lua) no longer remove active locks.