-
-
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
until_expired is not setting TTL #468
Comments
Hi @axos88, thanks for the report. May I ask which versions you are on? Sidekiq, sidekiq unique jobs, redis ruby client, redis server etc? Also would help if you could shed a light on any configuration you have for sidekiq like what other middleware are you using and so on and so forth? |
Hah. Yeah, sorry :) Ruby 2.7.0
No other middleware than the ones listed above. |
Similar issue |
@axos88 can you replicate this in a test? I tried the following but it seems to be working in the test suite at least: RSpec.describe "Issue 468" do
class MyWorker
include Sidekiq::Worker
sidekiq_options retry: 0, lock: :until_expired, lock_ttl: 5
end
specify do
expect(MyWorker.perform_async).not_to eq(nil)
expect(MyWorker.perform_async).to eq(nil)
sleep(6)
expect(MyWorker.perform_async).not_to eq(nil)
end
end This was tested on |
The only thing I can think of would be that one of the other gems are incompatible or misconfigured (in regards to how they relate to this gem). |
Sorry, I tested it on the wrong branch! Was a little late last night 🤔I can replicate it with this spec on branch |
Describe the bug
As far as I understand, this should create a lock with a TTL of 5 seconds, and allow the job to be enqueued every 5 seconds only. I'm not sure wether the counter should start from the time on enqueument, time it stated executing, or the time it finished. Anyways the job is pretty fast, so these are almost the same, but some documentation would be helpful.
Expected behavior
Allow the job to be enqueued later.
Current behavior
It gets permanently locked.
Redis shows the TTL of the key with a value of -1
Not sure what Grabbed and EXISTS are, but both have permanently been added:
Worker class
The text was updated successfully, but these errors were encountered: