-
-
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
while_executing + raise let non-unique jobs to be executed #534
Comments
@mhenrixon Can you possibly confirm? Or explain what timeout and ttl affects? How to choose the values? |
Please read https://github.com/mhenrixon/sidekiq-unique-jobs#while-executing If you configure a ttl then all jobs that are duplicate will wait for the same ttl as you configured before they are dropped. TTL is seconds not centiseconds. I chose to use pttl under the hood for better exactness while hiding that from the configuration to avoid very large numbers and difficulty understanding the number. |
@mhenrixon I might be missing something, but let's give it a try ( class TransferDataJob
include Sidekiq::Worker
sidekiq_options lock: :while_executing, lock_timeout: 10
def perform(params); sleep 5; end
end In
It says it timed out after 10 seconds but from the timestamps we can see that it happened after 2 seconds. By putting a debugging statement into the code we can see that what is passed to the
So we need to increase
Bingo. So Speaking of the README:
Which translates to:
"Unless" works only with simple conditions. I'd rather say:
or:
or just:
|
Meanwhile let me reopen this issue... |
There was a number of fixes in beta since then. I'd be interested in knowing if it is still a problem. This particular situation I haven't looked into but I did fix a number of things since then with the runtime locks (while executing) |
#571 v7.0.1 is highly recommended. I'm happy to reopen the issue and keep it v7 specific if you are still having trouble with |
Describe the bug
The bug is supposedly fixed here (
7.0.0.beta1
). I'm documenting it here for those struggling withsidekiq-unique-jobs-6.x
. Trysidekiq-unique-jobs-7.0.0.beta*
.Let's say you queue 3 non-unique jobs simultaneously.
Expected behavior
Only the first job starts. The rest fails. (Later they get retried.)
Current behavior
The first and the third jobs start.
Worker class
Additional context
I wonder if there's a way for it to not pollute the log with exceptions...
UPD There is:
It will wait 10 seconds till the other non-unique jobs finish. I.e. your job might be delayed by 10 seconds. If it can't acquire a lock in that time, it will raise an exception, the job will fail, and will be retried later by
sidekiq
.From what I can see, timeout defines how much time it waits for a lock, and ttl, how much time it waits for a promise to be resolved. As such ttl should be greater then timeout, and ttl is somehow in... centiseconds?.. O.o So I did:
The text was updated successfully, but these errors were encountered: