sidekiq-unique-jobs: Similar but unique keys are being treated as non-unique and conflicting with lock
Describe the bug
Similar, but different, unique keys are being marked as the same and skipping the job altogether
Expected behavior The job will run because it is unique
Current behavior A job that should run is getting skipped
Worker class
class MyWorker
include Sidekiq::Worker
sidekiq_options lock: :while_executing, queue: :undefault
def perform(id, table_name, file_key); end
end
Additional context Sets of args
3269, app_safts, app_safts0000_part_00
3275, app_safts, app_safts0001_part_00
3276, app_safts, app_safts0002_part_00
3281, app_safts, app_safts0003_part_00
The set 3275, app_safts, app_safts0001_part_00
got skipped. I have ~25 tables and their accompanying file sets that get queued around the same time and randomly a few of them will get skipped. I’ve logged where the jobs get queued to ensure the same job is not getting queued more than once
On version 7.1.2
I have also done a version with
def self.lock_args(args)
[args.last]
end
which led to more jobs getting skipped
About this issue
- Original URL
- State: open
- Created 3 years ago
- Comments: 17 (6 by maintainers)
I have a similar case and it reproduces stably on versions 7.1.5, 7.1.3 and 7.1.1. Worker:
When pushing a lot of tasks, sometimes collisions occur:
Maybe this will help find the reason.
LMK if want to hop on a zoom call to look at it
deleted the old one as some time had passed. tag me and I’ll post a new link 😃
@mhenrixon just saw this, but tomorrow I can do tomorrow morning. I’ll look to get on around 7 am MDT
I’m in MDT (Utah) and could do either day. If I need to wake up early let me know 😃