-
-
Notifications
You must be signed in to change notification settings - Fork 277
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
Version 6 Ignores Jobs Enqueued in Version 5 #345
Comments
I actually have tests saying this should work but it is pretty hard to to test this in an automated way. Have a look at: https://github.com/mhenrixon/sidekiq-unique-jobs/blob/master/spec/integration/sidekiq_unique_jobs/legacy_lock_spec.rb I even kept some of the old files to make sure the transition is smooth (and that I can create the same locks as v5 did). Any ideas what I am missing? |
Are you guys using redis namespace by any chance? |
No, we aren't using redis namespace. In version 6, when I call # SidekiqUniqueJobs::Lock::UntilExecuted
def execute
return unless locked? # Will exit without executing the job here if locked? is false
with_cleanup { yield }
end But version 5 didn't set this This is one way to examine the situation using context 'with a legacy lock' do
before do
result = SidekiqUniqueJobs::Scripts.call(
:acquire_lock,
redis_pool,
keys: [unique_digest],
argv: [lock_value, lock_expiration],
)
expect(result).to eq(1)
expect(unique_keys).to include(unique_digest)
end
context 'test if locked' do
let(:lock_value) { jid_one }
it 'is locked' do
puts "Redis keys: #{SidekiqUniqueJobs.redis(&:keys)}"
puts "locked?: #{locksmith_one.locked?}"
locksmith_one.send(:touch_grabbed_token, jid_one) # Only happens in version 6 during perform_async
puts "Redis keys: #{SidekiqUniqueJobs.redis(&:keys)}"
puts "locked?: #{locksmith_one.locked?}"
end
end
... This will result in:
|
Sorry it took so long @chadrschroeder, not sure if you still need it for an upgrade but it is now fixed and will be released with the next version. |
When upgrading from version 5 to version 6, any jobs that were enqueued on version 5 are removed from their Sidekiq queues and marked as processed in the Sidekiq log but they aren't actually executed. I think this is because the
GRABBED
key doesn't exist on the jobs that were enqueued on version 5 and SidekiqUniqueJobs silently exits before yielding to the worker.If possible, it would be nice if version 6 could just pick up and process these jobs. Otherwise, it might be worth documenting that the required upgrade steps are currently:
unique
requirement.The text was updated successfully, but these errors were encountered: