Open
Conversation
We occasionally have issues with publishing where we're unable to acquire a lock for a job via SidekiqUniqueJobs. We'd like to make it easier to understand what locks are currently in place This adds extra information to the locks created by SidekiqUniqueJobs and available via a Rails console or in the Sidekiq web UI. This includes the lock args: values that determine a job's uniqueness, which vary by job (see the individual job classes for their definitions) but generally include a base path or a content ID Accessing the lock info requires a digest, which is a hashed value generated by SidekiqUniqueJobs I think based on the payload. This digest and the lock args are visible together in the logs as the `message` https://github.com/mhenrixon/sidekiq-unique-jobs/blob/f67f34642bc9e85aeb999bf08fe0a5ef0aa6a12a/lib/sidekiq_unique_jobs/lock_digest.rb#L53-L61 To access the lock info via the console: ```rb digest = "uniquejobs:c83a5ff5da097c8a8bb2ae9034373327" SidekiqUniqueJobs::Lock.new(digest).info.value ``` To access the lock info via the Sidekiq web UI (in this example with a deployed instance port-forwarded to localhost:8080): http://localhost:8080/sidekiq/locks/uniquejobs:c83a5ff5da097c8a8bb2ae9034373327 Example lock info (in the console): ```rb { "worker" => "DownstreamDraftJob", "queue" => "downstream_low", "limit" => nil, "timeout" => 0, "ttl" => 3600, "type" => "until_executing", "lock_args" => [ "c6c6c598-31e6-472c-9266-fd6e559e6377", "en", false, [], "DownstreamDraftJob" ], "time" => 1772740352.249766, "at" => nil } ```
brucebolt
approved these changes
Mar 9, 2026
Member
brucebolt
left a comment
There was a problem hiding this comment.
This is a great find, I hadn't noticed this config option before.
The documentation says "create an additional key for the lock with a json object containing information about the lock". Have we checked the Redis instance will have enough memory to store this additional information during times of high load?
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.
We occasionally have issues with publishing where we're unable to acquire a lock for a job via SidekiqUniqueJobs. We'd like to make it easier to understand what locks are currently in place
This adds extra information to the locks created by SidekiqUniqueJobs and available via a Rails console or in the Sidekiq web UI. This includes the lock args: values that determine a job's uniqueness, which vary by job (see the individual job classes for their definitions) but generally include a base path or a content ID
Example lock info (in the console):