-
-
Notifications
You must be signed in to change notification settings - Fork 279
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
Fix active worker detection by using correct keys #756
Fix active worker detection by using correct keys #756
Conversation
Rename keys from :workers to :work since that's correct name set in Redis
Quick question: which Sidekiq and SidekiqUniqueJobs versions are you currently using? I want to make sure this gets backported if it concerns v7. |
sidekiq-unique-jobs (8.0.0) |
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. |
We are running |
Rename keys from :workers to :work since that's correct name set in Redis
Rename keys from :workers to :work since that's correct name set in Redis
* 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 <[email protected]> Co-authored-by: Egor Romanov <[email protected]> Co-authored-by: Jeremiah <[email protected]>
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
:workers
to:work
since 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.